-
Notifications
You must be signed in to change notification settings - Fork 3
CtcApi.Web
Shawn (work acct) edited this page Jun 8, 2013
·
2 revisions
See Simulating Session state for unit testing, etc. under CtcApi.Web.Mvc
The DummyWebResponse is simply a sub-classed WebResponse object. I can be useful for determining the state of the code at run-time - by checking the Type of the WebResponse returned from a method.
WebResponse response = new DummyWebResponse();
...
if (enableHttp)
{
response = request.GetResponse();
}
...
if (response is DummyWebResponse)
{
// No action was taken because HTTP was disabled.
}