Sorry I'm late, I've been crushed on trying to finish this app.
Here's my FixtureSetup that contains the routes.
[TestFixtureSetUp]
public void FixtureSetup()
{
RouteTable.Routes.Clear();
RouteTable.Routes.IgnoreRoute("{resource}.axd/
{*pathInfo}");
RouteTable.Routes.MapRoute("KitsByTag", "Kit/Tags/
{tagname}", new { controller = "Kit", action = "Tags", tagname =
"" });
RouteTable.Routes.MapRoute("KitAuthorFilter", "Kit/
AuthorIndex/{authorid}", new { controller = "Kit", action =
"AuthorIndex", authorid = "" });
RouteTable.Routes.MapRoute("KitSEOFriendly", "Kit/Details/
{title}", new { controller = "Kit", action = "Details", title = "" });
RouteTable.Routes.MapRoute("Default", "{controller}/
{action}/{id}", new { controller = "Home", action = "Index", id =
"" });
}
Once I added this I wasn't getting the same error. Now I'm getting
the error about the URL not matching any route.
TestCase
'M:MyCentral.UnitTests.KitTests.KitTests.Test_Route_To_KitController_And_Create_Action'
failed: The URL did not match any route
MVCContrib.TestHelper.AssertionException: The URL did not match any
route
at MVCContrib.TestHelper.RouteTestingExtensions.ShouldMapTo
[TController](RouteData routeData, Expression`1 action)
C:\WebProjects\MyCentral\MyCentral.UnitTests\KitTests\KitTests.cs
(519,0):
at
MyCentral.UnitTests.KitTests.KitTests.Test_Route_To_KitController_And_Create_Action
()
The weird thing about this is that it shows this error in the
TestDriven.Net VS 2008 addin but in the NUnit 2.5.1 GUI, it shows all
green.
Any thoughts?
On Sep 16, 9:49 am, Jeremy Skinner <jer...@jeremyskinner.co.uk> wrote:
> Could you post the rest of your test class?
>
> Thanks
>
> Jeremy
>
> 2009/9/16 kwilder <kahan...@gmail.com>
Jeremy,
Just curious, does it pass in the NUnit GUI? It passes for me there also, but not in the TestDriven.Net VS addin. It returns the “Url doesn’t match any route” exception. Do you think I should trust the NUnit GUI and not the TestDriven.Net addin?
Thanks.
King Wilder
Jeremy,
Ok, then there’s something wrong with one of those installations on my machine. I’ll check it out.
Thanks,
King Wilder
Jeremy,
One last thing and I’ll leave you alone.
I just tried moving the routes into my unit test method (and out of the FixtureSetup) and it passes using TestDriven.net. Any ideas why this happens?
I’m using NUnit 2.5.1 and I have the using statement in the test class.
using NUnit.Framework
Could it be some conflict in my Windows Vista Ultimate SP1 installation?
Thanks,
King Wilder
From: jeremy....@gmail.com [mailto:jeremy....@gmail.com] On Behalf Of Jeremy Skinner
Sent: Sunday, September 20, 2009 1:10 AM
No, I’m using an older Free Personal version (before he started charging for it), v2.9.2150. That’s probably the reason.
I’ll do that.