public void _UpdateTodo_Updates_one_Todo_And_Returns_A_PartialView() { var todo = todosList.First(); //specify the mockRepo return _mockRepository.Setup(repo => repo.update(todo)).Returns(1); //instantiate the controller var controller = new TodosController(_mockRepository.Object, _logger); //Call the controller action var result = controller._UpdateTodo(todo); //Assert the result var partialViewResult = Assert.IsType <PartialViewResult>(result); var model = partialViewResult.Model; //Assert the model model.Should().BeEquivalentTo(todo, options => options.ComparingByMembers <ToDoItemModel>()); }