Author: andrews
Date: 2006-07-05 12:21:48 -0400 (Wed, 05 Jul 2006)
New Revision: 62271
Modified:
trunk/mcs/class/System.Web/ChangeLog
trunk/mcs/class/System.Web/Makefile
trunk/mcs/class/System.Web/Test/System.Web/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs
Log:
add few HttpRequest.MapPath tests
Modified: trunk/mcs/class/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/ChangeLog 2006-07-05 15:53:27 UTC (rev
62270)
+++ trunk/mcs/class/System.Web/ChangeLog 2006-07-05 16:21:48 UTC (rev
62271)
@@ -1,3 +1,7 @@
+2006-07-05 Andrew Skiba <[EMAIL PROTECTED]>
+
+ * Makefile: add NunitWeb resources to 1.1 profile
+
2006-07-02 Vladimir Krasnov <[EMAIL PROTECTED]>
* System.Web_test.dll.sources: added FakeMembershipProvider.cs for
Modified: trunk/mcs/class/System.Web/Makefile
===================================================================
--- trunk/mcs/class/System.Web/Makefile 2006-07-05 15:53:27 UTC (rev 62270)
+++ trunk/mcs/class/System.Web/Makefile 2006-07-05 16:21:48 UTC (rev 62271)
@@ -84,11 +84,10 @@
Test/mainsoft/NunitWebResources/Web.sitemap \
Test/mainsoft/MainsoftWebTest/nunitweb_config.xml
-NUNIT_RESOURCE_FILES =
+NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
ifeq (net_2_0, $(PROFILE))
OTHER_RES += $(RESOURCE_FILES_2)
OTHER_LIB_MCS_FLAGS = -nowarn:618 -r:System.Configuration.dll
-NUNIT_RESOURCE_FILES = $(TEST_RESOURCE_FILES)
endif
LIB_MCS_FLAGS = \
Modified: trunk/mcs/class/System.Web/Test/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web/ChangeLog 2006-07-05
15:53:27 UTC (rev 62270)
+++ trunk/mcs/class/System.Web/Test/System.Web/ChangeLog 2006-07-05
16:21:48 UTC (rev 62271)
@@ -1,3 +1,7 @@
+2006-07-05 Andrew Skiba <[EMAIL PROTECTED]>
+
+ * HttpRequestTest: add MapPath tests
+
2006-06-21 Sebastien Pouliot <[EMAIL PROTECTED]>
* HttpWriter.cs: Fix test fixture not to inherit from
Modified: trunk/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs
2006-07-05 15:53:27 UTC (rev 62270)
+++ trunk/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs
2006-07-05 16:21:48 UTC (rev 62271)
@@ -33,6 +33,8 @@
using System.Collections.Specialized;
using NUnit.Framework;
using System.Diagnostics;
+using MonoTests.SystemWeb.Framework;
+using System.IO;
namespace MonoTests.System.Web {
@@ -138,7 +140,37 @@
HttpRequest r = new HttpRequest ("file", url, qs);
Assert.AreEqual("\u00e4", r.QueryString["umlaut"]);
- }
+ }
+ [Test]
+ [Category("aaa")]
+ public void Test_MapPath ()
+ {
+ WebTest t = new WebTest (new HandlerInvoker (new
HandlerDelegate (
+ MapPathDelegate)));
+ t.Run ();
+ }
+
+ static public void MapPathDelegate ()
+ {
+ HttpRequest r = HttpContext.Current.Request;
+ string appBase = r.PhysicalApplicationPath.TrimEnd
(Path.DirectorySeparatorChar);
+ Assert.AreEqual (appBase, r.MapPath ("~"), "test1");
+ Assert.AreEqual (appBase, r.MapPath ("/NunitWeb"),
"test1.1");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("Web.config"), "test2");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("~/Web.config"), "test3");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("/NunitWeb/Web.config"), "test4");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("Web.config", null, false), "test5");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("Web.config", "", false), "test6");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("Web.config", "/NunitWeb", false),
"test7");
+ Assert.AreEqual (Path.Combine (appBase, "Web.config"),
+ r.MapPath ("/NunitWeb/Web.config", "/NunitWeb",
false), "test8");
+ }
}
@@ -884,6 +916,7 @@
{
Assert.AreEqual("b\xE1r", context.Request.Form["foo"]);
}
+
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches