+2009-06-04 Marek Habersack <mhabersack@novell.com>
+
+ * RouteValueDictionaryExtensions.cs: if both values are strings in
+ Has (string, value), compare them case-insensitively. Fixes bug
+ #502555
+
2009-05-27 Marek Habersack <mhabersack@novell.com>
* PatternParser.cs: if Match is passed an empty path, do not
return false;
object entryValue;
- if (dict.TryGetValue (key, out entryValue))
+ if (dict.TryGetValue (key, out entryValue)) {
+ if (value is string) {
+ if (!(entryValue is string))
+ return false;
+
+ string s1 = value as string;
+ string s2 = entryValue as string;
+ return String.Compare (s1, s2, StringComparison.OrdinalIgnoreCase) == 0;
+ }
+
return entryValue == null ? value == null : entryValue.Equals (value);
-
+ }
+
return false;
}
+2009-06-04 Marek Habersack <mhabersack@novell.com>
+
+ * RouteCollectionTest.cs: added two more test cases to the bug
+ #502555 test. They check whether url generation matches defaults
+ case-insensitively.
+
2009-05-27 Marek Habersack <mhabersack@novell.com>
* RouteCollectionTest.cs: added a test for routes from
Assert.IsNotNull (vpd, "#C1");
Assert.AreEqual ("/Account/LogOn_modified", vpd.VirtualPath, "#C2");
Assert.AreEqual (0, vpd.DataTokens.Count, "#C3");
+
+ hc = new HttpContextStub2 ("~/", String.Empty, String.Empty);
+ hc.SetResponse (new HttpResponseStub (3));
+ rd = c.GetRouteData (hc);
+ vpd = c.GetVirtualPath (new RequestContext (hc, rd), new RouteValueDictionary (new { controller = "home" }) );
+ Assert.IsNotNull (vpd, "#D1");
+ Assert.AreEqual ("/", vpd.VirtualPath, "#D2");
+ Assert.AreEqual (0, vpd.DataTokens.Count, "#D3");
+
+ hc = new HttpContextStub2 ("~/", String.Empty, String.Empty);
+ hc.SetResponse (new HttpResponseStub (3));
+ rd = c.GetRouteData (hc);
+ vpd = c.GetVirtualPath (new RequestContext (hc, rd), new RouteValueDictionary (new { controller = "Home" }) );
+ Assert.IsNotNull (vpd, "#E1");
+ Assert.AreEqual ("/", vpd.VirtualPath, "#E2");
+ Assert.AreEqual (0, vpd.DataTokens.Count, "#E3");
}
[Test]