I have a case where i have to test Webservices methods which do not have HTTPContext as method parameters, but uses HTTPContext whcih comes from the browser inside the method.It is something like below:
[WebMethod()]
public string Method()
{
string result = String.Empty;
try
{
result = new AnotherClass().anotherMethod(classB.UserName(Context));
}
catch (Exception e)
{
throw new WebServiceException(e);
}
return result;
}
Note: Here Context is property of System.Web.Services.WebService class.
Here , How can i test above web service method with mocked HTTPContext.