lundi 2 mars 2015

How to use application variables in UnitTest asp.net

I have a method that uses Application variables to get information from an external file. Since Application variables are not used in unit tests, is there a way I can get the Application variables values from my Global.asax file and be able to use them in the test?


This is my test method:



[TestMethod]
public void TestGetCompanyList()
{
var accountController = new AccountServiceController();
CompanyInput cInput = new CompanyInput();
cInput.IssuerName = "Other";
cInput.Ticker = "BR";
var result
= accountController.GetCompanyList(cInput) as IEnumerable<CompanyListResult>;
Assert.IsNotNull(result);
}

Aucun commentaire:

Enregistrer un commentaire