Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/TestSupport
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29101/test/Spring/Spring.Web.Tests/TestSupport
Modified Files:
TestPage.cs TestWebContext.cs
Added Files:
TestWebContextTests.cs
Log Message:
introduced TestWebContextTests base class for unit testing web objects (Page,UserControl etc.)
added validation related tests
--- NEW FILE: TestWebContextTests.cs ---
(This appears to be a binary file; contents omitted.)
Index: TestPage.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/TestSupport/TestPage.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestPage.cs 28 Nov 2007 23:40:14 -0000 1.2
--- TestPage.cs 15 Mar 2008 11:19:39 -0000 1.3
***************
*** 40,47 ****
}
! protected override IDictionary CreateValidatorParameters()
{
! return null;
}
public new void SetResult(string resultName)
--- 40,54 ----
}
! public override System.Web.SessionState.HttpSessionState Session
{
! get
! {
! return null;
! }
}
+ // protected override IDictionary CreateValidatorParameters()
+ // {
+ // return null;
+ // }
public new void SetResult(string resultName)
Index: TestWebContext.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/TestSupport/TestWebContext.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestWebContext.cs 14 Mar 2008 12:02:46 -0000 1.5
--- TestWebContext.cs 15 Mar 2008 11:19:39 -0000 1.6
***************
*** 36,39 ****
--- 36,53 ----
private readonly TextWriter _out;
private readonly HttpWorkerRequest _wr;
+ [ThreadStatic] private static TestWebContext _wc;
+
+ public static void Create(string virtualPath, string page)
+ {
+ _wc = new TestWebContext(virtualPath, page);
+ }
+
+ public static void Release()
+ {
+ if (_wc != null)
+ {
+ _wc.Dispose();
+ }
+ }
public TestWebContext(string virtualPath, string page)
|