I am using nunit in my application. I want to access config file situated in my test project. I created a fake context via this:
HttpContext.Current = new HttpContext(
new HttpRequest(null, "http://tempuri.org", null),
new HttpResponse(null));
I can't access the config file by any of these:
System.Web.Hosting.HostingEnvironment.MapPath("~/MyConfig.config")
HttpContext.Current.Server.MapPath.MapPath("~/MyConfig.config")
System.Web.HttpServerUtility.MapPath("~/MyConfig.config")