public void Kontrollpanel_ikke_innlogget() { // Arrange var controller = new AdminController(new AdminLogikk(new AdminRepositoryStub())); var builder = new TestControllerBuilder(); builder.InitializeController(controller); controller.Session["AdminInnlogget"] = false; // Act var result = (RedirectToRouteResult)controller.Kontrollpanel(); // Assert Assert.AreEqual(result.RouteName, ""); Assert.AreEqual(result.RouteValues.Values.First(), "Innlogging"); }
public void Kontrollpanel() { // Arrange var controller = new AdminController(new AdminLogikk(new AdminRepositoryStub())); var builder = new TestControllerBuilder(); builder.InitializeController(controller); controller.Session["AdminInnlogget"] = true; // Act var result = (ViewResult)controller.Kontrollpanel(); // Assert Assert.AreEqual(result.ViewName, ""); }