Global.asax.cs and unittests
- From: "Peter Larsen [CPH]" <PeterLarsen@xxxxxxxxxxxxxxxx>
- Date: Fri, 5 Sep 2008 20:57:30 +0200
Hi,
I have a problem where the code in Global.asax.cs runs before the unittests
(on test of course).
In the global file, i load some data from a Oracle table and save it in
HttpApplicationState. This is happening in the Application_start function.
The following unittest show the beginning of the method, where the database
mock is created. If this mock isn't created, the unittest will try to access
the database - which is not allowed/possible from the build server.
[TestMethod()]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("C:\...Web", "/")]
[UrlToTest("http://localhost:2044/")]
[DeploymentItem("...Web.dll")]
public void PageTest()
{
DatabaseAccess.CreateDataAccessMock();
//the test code
}
The problem is that i want the mock to be created before the Global.asax.cs
file is called.
Is that possible ??
Thank you in advance.
BR
Peter
.
- Follow-Ups:
- RE: Global.asax.cs and unittests
- From: Steven Cheng [MSFT]
- RE: Global.asax.cs and unittests
- Prev by Date: Windows File Compression on Asp.net web files
- Next by Date: Re: onClientClick does not work correctly after deploying
- Previous by thread: Windows File Compression on Asp.net web files
- Next by thread: RE: Global.asax.cs and unittests
- Index(es):