Exemplo n.º 1
0
        public void index_should_return_home_stats_model()
        {
            // Arrange

            // Act
            var controller = new HomeController(null, null, null);
            var view = controller.Index();

            // Assert
            Assert.NotNull(view.Result);
            var model = view.Result.Model as HomeStatsModel;
            Assert.NotNull(model);
            controller.AssertGetAttribute("Index");
        }
Exemplo n.º 2
0
        public void index_should_return_home_stats_model()
        {
            // Arrange
            var authService = new Mock<IFormsAuthenticationService>();
            var demoService = new Mock<IDemoDataService>();

            // Act
            var controller = new HomeController(authService.Object, demoService.Object);
            var view = controller.Index();

            // Assert
            Assert.NotNull(view.Model);

            var model = view.Model as HomeStatsModel;
            Assert.NotNull(model);
        }
Exemplo n.º 3
0
        public void index_should_return_home_stats_model()
        {
            // Arrange
            var authService = new Mock<IFormsAuthenticationService>();
            var demoService = new Mock<IDemoDataService>();

            // Act
            var controller = new HomeController(authService.Object, demoService.Object);
            var view = controller.Index();

            // Assert
            Assert.NotNull(view.Model);

            var model = view.Model as HomeStatsModel;
            Assert.NotNull(model);
            Assert.IsTrue(controller.HasGetAttribute("Index"), "HttpGet attribute not found on HomeController's Index() action method");
        }