Пример #1
0
        public void homePage_IKKE_LOGGET_INN()
        {
            //Arrange
            var SessionMock = new TestControllerBuilder();
            var controller  = new ClearSkiesController();

            SessionMock.InitializeController(controller);
            controller.Session["LoggetInn"] = false;

            //Act
            var actionResult = (RedirectToRouteResult)controller.homePage();

            //Assert
            Assert.AreEqual("Login", actionResult.RouteValues.Values.First());
        }
Пример #2
0
        public void homePage_LOGGET_INN()
        {
            //Arrange
            var SessionMock = new TestControllerBuilder();
            var controller  = new ClearSkiesController();

            SessionMock.InitializeController(controller);
            controller.Session["LoggetInn"] = true;

            //Act
            var actionResult = (ViewResult)controller.homePage();

            //Assert
            Assert.AreEqual("", actionResult.ViewName);
        }