SPRNET-1271
-cannot reproduce -added unit tests around the HandlerMap class' MapPath() method so that if a subsequent example of the behavior reported in this issue is provided we can properly test against it
This commit is contained in:
@@ -128,6 +128,7 @@
|
||||
<Compile Include="Web\Support\ControlInterceptionTests.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Web\Support\HandlerMapTests.cs" />
|
||||
<Compile Include="Web\Support\LocalResourceManagerTests.cs" />
|
||||
<Compile Include="Web\Support\MimeMediaTypeTests.cs" />
|
||||
<Compile Include="Web\Support\PageHandlerFactoryTests.cs" />
|
||||
|
||||
47
test/Spring/Spring.Web.Tests/Web/Support/HandlerMapTests.cs
Normal file
47
test/Spring/Spring.Web.Tests/Web/Support/HandlerMapTests.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Spring.Web.Support
|
||||
{
|
||||
[TestFixture]
|
||||
public class HandlerMapTests
|
||||
{
|
||||
[Test]
|
||||
public void CanMatch_EmbeddedLiteralsPattern()
|
||||
{
|
||||
HandlerMap map = new HandlerMap();
|
||||
map.Add("/*/test2/*", "theHandlerIWant");
|
||||
|
||||
HandlerMapEntry handler = map.MapPath("/test1/test2/default.aspx");
|
||||
|
||||
Assert.NotNull(handler);
|
||||
Assert.AreEqual("theHandlerIWant", handler.HandlerObjectName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanMatch_ExactStringPatterns()
|
||||
{
|
||||
HandlerMap map = new HandlerMap();
|
||||
map.Add("/test1/test2/default.aspx", "theHandlerIWant");
|
||||
|
||||
HandlerMapEntry handler = map.MapPath("/test1/test2/default.aspx");
|
||||
|
||||
Assert.NotNull(handler);
|
||||
Assert.AreEqual("theHandlerIWant", handler.HandlerObjectName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanMatch_LeadingLiteralsPattern()
|
||||
{
|
||||
HandlerMap map = new HandlerMap();
|
||||
map.Add("/test1/*", "theHandlerIWant");
|
||||
|
||||
HandlerMapEntry handler = map.MapPath("/test1/test2/default.aspx");
|
||||
|
||||
Assert.NotNull(handler);
|
||||
Assert.AreEqual("theHandlerIWant", handler.HandlerObjectName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user