vendredi 31 juillet 2015

How can I unit test an MVC Action that returns a PartialViewResult with null model?

I am new to unit testing.

I have an action:

[HttpPost]
public PartialViewResult Details(Details model, string action)
{
    // .. some logic
    return this.PartialView("_details", model);
}

and I want to write a test for a situation when the model passed to the action is null and/ or action parameter is empty.

How to do such a test?

Aucun commentaire:

Enregistrer un commentaire