2005-09-29 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 30 Sep 2005 03:39:03 +0000 (03:39 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 30 Sep 2005 03:39:03 +0000 (03:39 -0000)
* HttpBrowserCapabilitiesCas.cs: Fixed tests case to work with both
values returned by Mono and MS runtimes.
* HttpContextCas.cs: Ignore the Application_Deny_UnmanagedCode test
case. This check was removed in 2.0 and seems to be inconsistent in
previous versions (i.e. depends on the execution order which triggers
the initialization of the HttpRuntime).

svn path=/trunk/mcs/; revision=51026

mcs/class/System.Web/Test/System.Web/ChangeLog
mcs/class/System.Web/Test/System.Web/HttpBrowserCapabilitiesCas.cs
mcs/class/System.Web/Test/System.Web/HttpContextCas.cs

index 99e829772a4ce34736f6d751a758f8e7b2656282..0323405e45c36da2c580427205e73b6f590fa50d 100644 (file)
@@ -1,3 +1,12 @@
+2005-09-29  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * HttpBrowserCapabilitiesCas.cs: Fixed tests case to work with both
+       values returned by Mono and MS runtimes.
+       * HttpContextCas.cs: Ignore the Application_Deny_UnmanagedCode test 
+       case. This check was removed in 2.0 and seems to be inconsistent in
+       previous versions (i.e. depends on the execution order which triggers
+       the initialization of the HttpRuntime).
+
 2005-09-23  Sebastien Pouliot  <sebastien@ximian.com>
 
        * HttpContextCas.cs: Mono throws ArgumentNullException for RewritePath
index a3bac3b7b1d65db01b3872ba4044fd383e774b7a..f08abbb0e808331f9f6943b6c3d3d937dfe70b2d 100755 (executable)
@@ -42,7 +42,7 @@ namespace MonoCasTests.System.Web {
        class BoolHttpBrowserCapabilities : HttpBrowserCapabilities {
 
                public override string this [string key] {
-                       get { return "true"; }
+                       get { return (key == "platform") ? "Win32" : "true"; }
                }
        }
 
@@ -111,7 +111,9 @@ namespace MonoCasTests.System.Web {
                public void TypeProperties_Deny_Unrestricted ()
                {
                        HttpBrowserCapabilities cap = new StringHttpBrowserCapabilities ();
-                       Assert.IsNull (cap.TagWriter, "TagWriter");
+                       Type t = cap.TagWriter;
+                       // note: right now the value is hardcoded in Mono, i.e. it doesn't come from the ini file
+                       Assert.IsTrue (((t == null) || (t == typeof (HtmlTextWriter))), "TagWriter");
                }
 
                [Test]
index 05d2f75b2d4dada2477d04359be65dc5ae5060ed..3e26c27e9a4ac15968a55b83f3dcfc35b4be4b2c 100644 (file)
@@ -109,8 +109,14 @@ namespace MonoCasTests.System.Web {
                [Test]
                [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
                [ExpectedException (typeof (SecurityException))]
+               [Ignore ("occurs only in certain conditions - removed in 2.0")]
                public void Application_Deny_UnmanagedCode ()
                {
+                       // The SecurityException doesn't always occurs (e.g. CAS unit tests
+                       // works for HttpContextCas alone but will fail if the whole suit
+                       // is executed). This is because the value is cached and may be 
+                       // created differently (without the check). This is _probably_ why
+                       // this check has been removed in 2.0.
                        Assert.IsNotNull (context.Application, "Application");
                }