Author: toshok
Date: 2005-11-14 23:44:33 -0500 (Mon, 14 Nov 2005)
New Revision: 53036

Added:
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthenticationSectionTest.cs
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationRuleTest.cs
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationSectionTest.cs
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BufferModeSettingsTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.Configuration/BuildProviderTest.cs
Modified:
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AnonymousIdentificationSectionTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.Configuration/ChangeLog
Log:
2005-11-14  Chris Toshok  <[EMAIL PROTECTED]>

        * AnonymousIdentificationSectionTest.cs: remove MS stacktrace
        comment.

        * BuildProviderTest.cs: new tests.

        * AuthorizationRuleTest.cs: new tests.

        * AuthorizationSectionTest.cs: new tests.

        * AuthenticationSectionTest.cs: new tests.

        * BufferModeSettingsTest.cs: new tests.



Modified: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AnonymousIdentificationSectionTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AnonymousIdentificationSectionTest.cs
      2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AnonymousIdentificationSectionTest.cs
      2005-11-15 04:44:33 UTC (rev 53036)
@@ -58,16 +58,6 @@
                        Assert.AreEqual (false, a.Enabled, "A9");
                }
 
-               /* MS throws for these tests something like:
-                  at 
System.Configuration.ConfigurationProperty.Validate(Object value)
-                  at 
System.Configuration.ConfigurationElement.SetPropertyValue(ConfigurationProperty
 prop, Object value, Boolean ignoreLocks)
-                  at 
System.Configuration.ConfigurationElement.set_Item(ConfigurationProperty prop, 
Object value)
-                  at 
System.Web.Configuration.AnonymousIdentificationSection.set_CookieName(String 
value)
-                  at 
MonoTests.System.Web.Configuration.AnonymousIdentificationSectionTest.CookieName_validationFailure()
-                  --ConfigurationErrorsException
-                  at System.Configuration.StringValidator.Validate(Object 
value)
-                  at 
System.Configuration.ConfigurationProperty.Validate(Object value)
-               */
                [Test]
                [ExpectedException (typeof (ConfigurationErrorsException))]
                public void CookieName_validationFailure ()

Added: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthenticationSectionTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthenticationSectionTest.cs
       2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthenticationSectionTest.cs
       2005-11-15 04:44:33 UTC (rev 53036)
@@ -0,0 +1,60 @@
+//
+// AuthenticationSectionTest.cs 
+//     - unit tests for System.Web.Configuration.AuthenticationSection
+//
+// Author:
+//     Chris Toshok  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using NUnit.Framework;
+
+using System;
+using System.Configuration;
+using System.Web.Configuration;
+using System.Web;
+using System.Web.Security;
+
+namespace MonoTests.System.Web.Configuration {
+
+       [TestFixture]
+       public class AuthenticationSectionTest  {
+
+               [Test]
+               public void Defaults()
+               {
+                       AuthenticationSection a = new AuthenticationSection();
+
+                       Assert.IsNotNull (a.Forms, "A1");
+                       Assert.AreEqual (typeof 
(FormsAuthenticationConfiguration), a.Forms.GetType(), "A2");
+                       Assert.IsNotNull (a.Passport, "A3");
+                       Assert.AreEqual (typeof (PassportAuthentication), 
a.Passport.GetType(), "A4");
+                       Assert.AreEqual (AuthenticationMode.Windows, a.Mode, 
"A5");
+               }
+       }
+
+}
+
+#endif

Added: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationRuleTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationRuleTest.cs
   2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationRuleTest.cs
   2005-11-15 04:44:33 UTC (rev 53036)
@@ -0,0 +1,77 @@
+//
+// AuthorizationRuleTest.cs 
+//     - unit tests for System.Web.Configuration.AuthorizationRule
+//
+// Author:
+//     Chris Toshok  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using NUnit.Framework;
+
+using System;
+using System.Configuration;
+using System.Web.Configuration;
+using System.Web;
+using System.Web.Security;
+
+namespace MonoTests.System.Web.Configuration {
+
+       [TestFixture]
+       public class AuthorizationRuleTest  {
+
+               [Test]
+               public void Defaults()
+               {
+                       AuthorizationRule a = new 
AuthorizationRule(AuthorizationRuleAction.Deny);
+
+                       Assert.AreEqual (AuthorizationRuleAction.Deny, 
a.Action, "A1");
+                       Assert.IsNotNull (a.Roles, "A2");
+                       Assert.IsNotNull (a.Users, "A3");
+                       Assert.IsNotNull (a.Verbs, "A4");
+               }
+
+               [Test]
+               public void Test_EqualsAndHashCode ()
+               {
+                       AuthorizationRule a = new AuthorizationRule 
(AuthorizationRuleAction.Deny);
+                       AuthorizationRule b = new AuthorizationRule 
(AuthorizationRuleAction.Deny);
+
+                       a.Users.Add ("toshok");
+                       a.Roles.Add ("Admin");
+                       a.Verbs.Add ("reboot");
+
+                       b.Users.Add ("toshok");
+                       b.Roles.Add ("Admin");
+                       b.Verbs.Add ("reboot");
+
+                       Assert.AreEqual (a, b, "A1");
+                       Assert.AreEqual (a.GetHashCode (), b.GetHashCode (), 
"A2");
+               }
+       }
+
+}
+
+#endif

Added: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationSectionTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationSectionTest.cs
        2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/AuthorizationSectionTest.cs
        2005-11-15 04:44:33 UTC (rev 53036)
@@ -0,0 +1,57 @@
+//
+// AuthorizationSectionTest.cs 
+//     - unit tests for System.Web.Configuration.AuthorizationSection
+//
+// Author:
+//     Chris Toshok  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using NUnit.Framework;
+
+using System;
+using System.Configuration;
+using System.Web.Configuration;
+using System.Web;
+using System.Web.Security;
+
+namespace MonoTests.System.Web.Configuration {
+
+       [TestFixture]
+       public class AuthorizationSectionTest  {
+
+               [Test]
+               public void Defaults()
+               {
+                       AuthorizationSection a = new AuthorizationSection ();
+
+                       Assert.IsNotNull (a.Rules, "A1");
+                       Assert.AreEqual (0, a.Rules.Count, "A2");
+               }
+       }
+
+}
+
+#endif

Added: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BufferModeSettingsTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BufferModeSettingsTest.cs
  2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BufferModeSettingsTest.cs
  2005-11-15 04:44:33 UTC (rev 53036)
@@ -0,0 +1,102 @@
+//
+// BufferModeSettingsTest.cs 
+//     - unit tests for System.Web.Configuration.BufferModeSettings
+//
+// Author:
+//     Chris Toshok  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using NUnit.Framework;
+
+using System;
+using System.Configuration;
+using System.Web.Configuration;
+using System.Web;
+using System.Web.Security;
+
+namespace MonoTests.System.Web.Configuration {
+
+       [TestFixture]
+       public class BufferModeSettingsTest  {
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void MaxBufferSize_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.MaxBufferSize = 0;
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void MaxBufferThreads_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.MaxBufferThreads = 0;
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void MaxFlushSize_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.MaxFlushSize = 0;
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void Name_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.Name = "";
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void RegularFlushInterval_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.RegularFlushInterval = TimeSpan.FromSeconds (-30);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void UrgentFlushThreshold_validationFailure ()
+               {
+                       BufferModeSettings b = new BufferModeSettings ("hi", 
Int32.MaxValue, 1, Int32.MaxValue, TimeSpan.FromSeconds (1), TimeSpan.Zero, 
Int32.MaxValue);
+
+                       b.UrgentFlushThreshold = 0;
+               }
+       }
+
+}
+
+#endif

Added: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BuildProviderTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BuildProviderTest.cs   
    2005-11-15 00:06:58 UTC (rev 53035)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/BuildProviderTest.cs   
    2005-11-15 04:44:33 UTC (rev 53036)
@@ -0,0 +1,91 @@
+//
+// BuildProviderTest.cs 
+//     - unit tests for System.Web.Configuration.BuildProvider
+//
+// Author:
+//     Chris Toshok  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using NUnit.Framework;
+
+using System;
+using System.Configuration;
+using System.Web.Configuration;
+using System.Web;
+using System.Web.Security;
+
+namespace MonoTests.System.Web.Configuration {
+
+       [TestFixture]
+       public class BuildProviderTest  {
+
+               [Test]
+               public void EqualsAndHashCode ()
+               {
+                       BuildProvider b1, b2;
+
+                       b1 = new BuildProvider (".hi", "System.Bye");
+                       b2 = new BuildProvider (".hi", "System.Bye");
+
+                       Assert.IsTrue (b1.Equals (b2), "A1");
+                       Assert.AreEqual (b1.GetHashCode (), b2.GetHashCode (), 
"A2");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void ctor_validationFailure1 ()
+               {
+                       BuildProvider b = new BuildProvider ("", "hi");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void ctor_validationFailure2 ()
+               {
+                       BuildProvider b = new BuildProvider ("hi", "");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void Extension_validationFailure ()
+               {
+                       BuildProvider b = new BuildProvider ("hi", "bye");
+
+                       b.Extension = "";
+               }
+
+               [Test]
+               [ExpectedException (typeof (ConfigurationErrorsException))]
+               public void Type_validationFailure ()
+               {
+                       BuildProvider b = new BuildProvider ("hi", "bye");
+
+                       b.Type = "";
+               }
+       }
+}
+
+#endif

Modified: trunk/mcs/class/System.Web/Test/System.Web.Configuration/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.Configuration/ChangeLog  
2005-11-15 00:06:58 UTC (rev 53035)
+++ trunk/mcs/class/System.Web/Test/System.Web.Configuration/ChangeLog  
2005-11-15 04:44:33 UTC (rev 53036)
@@ -1,3 +1,18 @@
+2005-11-14  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * AnonymousIdentificationSectionTest.cs: remove MS stacktrace
+       comment.
+
+       * BuildProviderTest.cs: new tests.
+
+       * AuthorizationRuleTest.cs: new tests.
+
+       * AuthorizationSectionTest.cs: new tests.
+
+       * AuthenticationSectionTest.cs: new tests.
+
+       * BufferModeSettingsTest.cs: new tests.
+
 2005-11-13  Chris Toshok  <[EMAIL PROTECTED]>
 
        * AssemblyInfoTest.cs: programmatic property access tests.

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to