c# - How to compare viewmodel and dependency in unit testing? -
below code of method :- [httppost] public actionresult index(productviewmodel model) { if (model != null) { return partialview("_productgrid", getproduct(model)); } else { return redirecttoaction("index", "product"); } } and below code unit testing method (in c#,mvc) :- [testmethod] public void index_withmodel_posttest() { //arrange productcontroller controller = new productcontroller(); var model = new productviewmodel() { name="product1", description="desc" }; //act partialviewresult actual = controller.index(model) partialviewresult; if (actual != null) { var viewmodel = (productviewmodel)((viewresultbase)(actual)).model; int matches = _productservice.getdeals("", model...