I have this controller method:
[GET("/whatever/list")]
public ActionResult Index(string sortby, string order)
I am trying to verify it using the MvcContrib route test:
"~/whatever/list".ShouldMapTo<MyController>(c => c.Index(string.Empty, string.Empty));
"~/whatever/list?sortby=type&order=desc".ShouldMapTo<MyController>(c => c.Index("type", "desc"));
However, it returns this error.
Failure: MvcContrib.TestHelper.AssertionException: value for "sortby" did not match: expected '', but was ''; it doesn't matter if itβs found in the route context action parameter named "sortby" - does your corresponding route contain a token called "sortby"?
What am I missing?
source
share