Error running Ivonna tests with ASP.NET 4
When I tried to run a working Ivonna test, previously targeted at .NET 3.5, against .NET 4 I found my test failing with the error
------ Test started: Assembly: Webpart.Tests.dll ------
Bad RequestSetup information Physical Web path: C:ProjectsTestTypeMockSampleTestWebSite Actual path: C:UsersfezAppDataLocalTempTemporary ASP.NET Filesroot156567f2Turns out that the fix to simple, you have to use an absolute path i.e. the / in front of the BasicTest.aspx is vital
1\[TestMethod, Isolated\]
public void LoadWebPage\_HelloWorldWebPart\_NoError()
1 {
TestSession session = new TestSession(); //Start each test with this
1 WebRequest request = new WebRequest("/BasicTest.aspx"); //Create a WebRequest object
WebResponse response = session.ProcessRequest(request); //Process the request
1 System.Web.UI.Page page = response.Page;
//Check the page loaded
1 Assert.IsNotNull(page);
}
1
2So this is a temporary work around for now, for me it is not an issue having to use a absolute path. I understand from the [writer of Ivonna](http://www.sm-art.biz/Ivonna.aspx) that this issue will be further investigated now that .NET 4.0 has RTM’d