public void Viewbag_Values_Are_Correct_Index_BlogController() { // Arrange BlogController cut = new BlogController(_postRepository); // Act var result = cut.Index() as ViewResult; // Assert _postRepository.AssertWasCalled(pr => pr.RecentPosts(10)); Assert.IsNotNull(result.Model); }
public void Returns_Correct_Post_Archive_BlogController() { // Arrange BlogController cut = new BlogController(_postRepository); // Act var result = cut.Archive("my_first_test") as ViewResult; // Assert Assert.IsNotNull(result.Model, "The Model in the result is null."); _postRepository.AssertWasCalled(a => a.Find("my_first_test")); }