public void CreateFeeds_CallTheIndexAction_EnsuresEmptyResultWhenModuleIsNotActivated() { // Arrange using (var controller = new DummyFeedController(false)) { // Act var view = controller.Index() as EmptyResult; // Assert Assert.IsNotNull(view); } }
public void CreateFeeds_CallTheIndexAction_EnsuresCustomTemplateIsChanged() { // Arrange using (var controller = new DummyFeedController()) { controller.TemplateName = "CustomTemplate"; // Act var view = controller.Index() as ViewResult; // Assert Assert.IsNotNull(view); Assert.IsTrue(view.ViewName == "Feed.CustomTemplate"); } }
public void CreateFeeds_CallTheIndexAction_EnsuresTheModelIsProperlyCreated() { // Arrange using (var controller = new DummyFeedController()) { // Act var view = controller.Index() as ViewResult; var model = view.Model; var feedViewModel = model as FeedViewModel; // Assert Assert.IsNotNull(feedViewModel, "The model is created correctly."); Assert.IsTrue(view.ViewName == "Feed.FeedLink"); } }