コード例 #1
0
        public void IndexViaDefaultConstructor()
        {
            // Arrange
            var controller = new HomeController();

            // Act
            var result = controller.Index();

            // Assert
            Assert.That(result, Is.Not.Null);
            Assert.IsInstanceOf<ViewResult>(result);
            var result2 = (ViewResult)result;
            Assert.IsEmpty(result2.ViewBag.Message, "message");
            Assert.AreEqual(false, result2.ViewBag.ExtraMenuFeature, "extra menu feature flag");
        }
コード例 #2
0
        public void IndexWithNewPage()
        {
            // Arrange
            _menuSetting.ShowNewMenu = true;
            var controller = new HomeController(_menuSetting);

            // Act
            var result = controller.Index();

            // Assert
            Assert.That(result, Is.Not.Null);
            Assert.IsInstanceOf<ViewResult>(result);
            var result2 = (ViewResult)result;
            Assert.IsEmpty(result2.ViewBag.Message, "message");
            Assert.AreEqual(true, result2.ViewBag.ExtraMenuFeature, "extra menu feature flag");
        }