2007-01-17 Adar Wesley <adarw@mainsoft.com>
authorAdar Wesley <adar@mono-cvs.ximian.com>
Wed, 17 Jan 2007 10:14:27 +0000 (10:14 -0000)
committerAdar Wesley <adar@mono-cvs.ximian.com>
Wed, 17 Jan 2007 10:14:27 +0000 (10:14 -0000)
        * ApplicationHost.cs: tweaking CreateApplicationHost to throw the
        right exceptions so the tests will pass.

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

mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
mcs/class/System.Web/System.Web.Hosting/ChangeLog
mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs

index 4b147e547d65433f3e4fcd09c366cf7f930b951d..2be68cfbc3b294352a6c53f8c815760cf7041533 100644 (file)
@@ -86,10 +86,10 @@ namespace System.Web.Hosting {
                        physicalDir = Path.GetFullPath (physicalDir);
 
                        if (hostType == null)
-                               throw new NullReferenceException ();
+                               throw new ArgumentException ("hostType can't be null");
 
                        if (virtualDir == null)
-                               throw new NullReferenceException ();
+                               throw new ArgumentNullException ("virtualDir");
 
                        Evidence evidence = new Evidence (AppDomain.CurrentDomain.Evidence);
 
index 1dbac9d5c3854147035752e62bcdd959f153a622..21c50f83b459f7b0d2c57c659582633488092360 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-17  Adar Wesley <adarw@mainsoft.com>
+
+       * ApplicationHost.cs: tweaking CreateApplicationHost to throw the 
+       right exceptions so the tests will pass.
+
 2007-01-11  Adar Wesley <adarw@mainsoft.com>
 
        * ApplicationHost.cs: fixed AppDomain initialization of physical
index 13f7d439733a5769ce429045e4a5ca349657eb77..ba0c07a1d86da1b7ec9cbf5196c51e359cd4d779 100644 (file)
@@ -94,33 +94,22 @@ namespace MonoTests.System.Web.Hosting {
                }
 
                [Test]
-        [Category ("NotWorking")]
         [ExpectedException (typeof (ArgumentException))]
                public void ConstructorTestNull2 ()
                {
-                       //
-                       // Throws an Uri exception from Uri.Parse
-                       //
                        ApplicationHost.CreateApplicationHost (null, "/app", ".");
                }
 
                [Test]
-        [Category("NotWorking")]
         [ExpectedException (typeof (ArgumentNullException))]
                public void ConstructorTestNull3 ()
                {
-                       //
-                       // Throws an Uri exception from Uri.Parse
-                       //
                        ApplicationHost.CreateApplicationHost (typeof (MBR), null, ".");
                }
 
                [Test][ExpectedException (typeof (NullReferenceException))]
                public void ConstructorTestNull4 ()
                {
-                       //
-                       // Throws an Uri exception from Uri.Parse
-                       //
                        ApplicationHost.CreateApplicationHost (typeof (MBR), "/app", null);
                }
 
@@ -162,8 +151,8 @@ namespace MonoTests.System.Web.Hosting {
                        AppDomain other = m.GetDomain ();
                        AppDomainSetup setup = other.SetupInformation;
 
-                       string tb = Environment.CurrentDirectory.Replace ("\\","/");
-                       if (tb.EndsWith ("/"))
+                       string tb = Environment.CurrentDirectory;
+                       if (tb[tb.Length - 1] == Path.DirectorySeparatorChar)
                                tb = tb.Substring (0, tb.Length - 1);
 
                        // Need to fix an issue in AppDomainSetup
@@ -171,7 +160,7 @@ namespace MonoTests.System.Web.Hosting {
                        
                        p ("AppDomain's Applicationname is: ", setup.ApplicationName);
                        Assert.AreEqual (null, setup.CachePath, "D2");
-                       Assert.AreEqual (tb + "/web.config", setup.ConfigurationFile, "D3");
+                       Assert.AreEqual (tb + Path.DirectorySeparatorChar + "web.config", setup.ConfigurationFile, "D3");
                        Assert.AreEqual (false, setup.DisallowBindingRedirects, "D4");
                        Assert.AreEqual (true, setup.DisallowCodeDownload, "D5");
                        Assert.AreEqual (false, setup.DisallowPublisherPolicy, "D6");