Ejemplo n.º 1
0
        public void CreateFeeds_CallTheIndexAction_EnsuresEmptyResultWhenModuleIsNotActivated()
        {
            // Arrange
            using (var controller = new DummyFeedController(false))
            {
                // Act
                var view = controller.Index() as EmptyResult;

                // Assert
                Assert.IsNotNull(view);
            }
        }
Ejemplo n.º 2
0
        public void CreateFeeds_CallTheIndexAction_EnsuresEmptyResultWhenModuleIsNotActivated()
        {
            // Arrange
            using (var controller = new DummyFeedController(false))
            {
                // Act
                var view = controller.Index() as EmptyResult;

                // Assert
                Assert.IsNotNull(view);
            }
        }
Ejemplo n.º 3
0
        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");
            }
        }
Ejemplo n.º 4
0
        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");
            }
        }
Ejemplo n.º 5
0
        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");
            }
        }
Ejemplo n.º 6
0
        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");
            }
        }