How to test route with several parameters?

Oct 9, 2012 at 10:41 PM
Edited Oct 9, 2012 at 10:44 PM

Hello Everyone!

I got this test which attempts to test a route with parameters, and it fails:

_tester.WithIncomingRequest("/Asset/ChangeAssetCategory?assetId=5&newCategoryId=5") .ShouldMatchRoute("Asset", "ChangeAssetCategory", new {assetId = 5, newCategoryId = 5});

However this one passes fine, but it's not exactly what I need:

_tester.WithIncomingRequest("/Asset/ChangeAssetCategory?assetId=5&newCategoryId=5") .ShouldMatchRoute("Asset", "ChangeAssetCategory");

What am I doing wrong here? Is there a better way to test this kind of route?

Thanks in advance! :)