public static string Test()
{
var page = HttpContext.Current.Request.QueryString["page"];
var pageSize = HttpContext.Current.Request.QueryString["pageSize"];
var sortBy = HttpContext.Current.Request.QueryString["sortBy"];
var sortOrder = HttpContext.Current.Request.QueryString["sortOrder"];
var searchBy = HttpContext.Current.Request.QueryString["searchBy"];
var searchKey = HttpContext.Current.Request.QueryString["searchKey"];
if (!StandardRegister.AppServices.Security.Authenticator.VerifyAuthentication())
{
return null;
}
}
unit test
[Test]
public async Task GetMaintainKitsTest()
{
HttpContext.Current.Request.QueryString.Add("page", "1");
var maintainKits = Test();
}
error:Object reference not set to an instance of an object.
so to add HttpContext.Current.Request.QueryString in unit test