I am new to unit test, MSTest. I get NullReferenceException. How do I set HttpContext.Current.Server.MapPath for doing unit test in C#.
class Account
{
protected string accfilepath;
public Account(){
accfilepath=HttpContext.Current.Server.MapPath("~/files/");
}
}
class Test{
[TestMethod]
public void TestMethod()
{
Account ac= new Account();
}
}
Aucun commentaire:
Enregistrer un commentaire