I have an Action as follows:
public PartialViewResult MyActionIWantToTest(string someParameter)
{
// ... A bunch of logic
return PartialView("ViewName", viewModel);
}
When I inspect the result, It has a few properties, but they are either null, or empty.
The only property that has anything is the ViewEngineCollection which doesn’t contain anything specific to my method.
Does anyone have some example code that tests a PartialViewResult?
Say you have an
Actionthat looks something like this:Note:
MyPartialViewModelis a simple class with only one property –SomeValue.An NUnit example may look like this: