Closed AnthonySteele closed 11 years ago
It must be possible, Html.ActionLink does something along these lines...?
Does it actually add anything important though?
Well, it could be nice to be able to test like this... so you're sure the action routes etc... are generated as expected?
What does it do that the exiting test doesn't?
Good point.... Just another fluent way of expressing expected result i guess....
Not essential at all
We have code for it here: https://github.com/AnthonySteele/MvcRouteTester/pull/18 Specifically it tests that the url generated by Url.Action for a particular controller and action name is as expected, which also tests the route table in a slightly different way.
Any ideas about feasibility and need for testing the other way around, i.e. instead of testing that a url is mapped to a particular controller method "routes.ShouldMap("/").To(x => x.Index());"
we test that a given controller method generates a url, something like:
routes.Action(x => x.Index()).ShouldMapToUrl("/")
Is this important? Hard?