I have the following action that Im trying to unit test:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Default(ProductsViewModel model)
{
var locationId = model.LocationId;
var locationText = model.LocationText;
return locationId > 0 ? Summary(locationId, locationText, 1, "Date", true) : View();
}
If the viewmodel is empty, then just a view is returned. But if it contains an id, then the summary action is called and does all the work (calling the db, building a new viewmodel etc).
But how can I assert in a unit test that it was called?