Steve
unread,Oct 19, 2009, 5:21:50 AM10/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mvccontrib-discuss
Hi there. I've just belatedly started trying to get my head around
Unit Tests, and wanted to use ShouldMapTo for outbound routing tests.
I'm getting the following message though:
System.Security.VerificationException: Method
MvcContrib.TestHelper.RouteTestingExtensions.ShouldMapTo: type
argument 'GPv3mvc.Controllers.LatestController' violates the
constraint of type parameter 'TController'.
My test is:
[Test]
public void
All_Headlines_Page_1_Is_At_Slash_Latest_Slash_Headlines()
{
"~/Latest/Headlines".ShouldMapTo<LatestController>(x =>
x.Headlines(string.Empty, 1));
}
My LatestController is derived from MasterPageController, which is my
own implementation but which in turn derives from Controller. This
seemed like the obvious problem, but if I change LatestController to
derive directly from Controller I get the same error.
I'm wondering if I'm missing something obvious, or if this is an MVC 2
Preview 2 issue (which is what I'm using). I've downloaded the latest
MVCContrib RC to see if it helped, but it hasn't.
Sorry if this has been covered before, but some Googling hasn't found
any other mention.