I am trying to test my routing configuration using the excellent MvcContrib.TestHelper and I've run into a problem.
Please assume that my Routing Configuration is set up correctly and initialised in the TestFixture.
I have a controller (TransactionsController) action called Create that takes an input parameter of type TransactionRecord:
[Trace, AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(TransactionRecord tx)
{
...
}
Currently my test is as follows:
[Test]
public void TestRoute_POST_Transactions_Create()
{
"~/Transactions/".WithMethod(HttpVerbs.Post).ShouldMapTo<Web.Controllers.TransactionsController>(x => x.Create());
}
My problem is that the Create() method takes a parameter of type TransactionRecord, I do not know how to incorporate this into my test.
I've not been able to find any examples of this nature.