public void produkt_ok()
        {
            var mock = new Mock<ControllerContext>();
            mock.SetupGet(u => u.HttpContext.Request.IsAuthenticated).Returns(true);
            mock.SetupGet(u => u.HttpContext.User.Identity.Name).Returns("123");

            var controller = new AdminController(new Mock<IAuth>().Object, new AdminLogikk(new ansattRepositoryStub()),
                new ProdukterLogikk(new ProduktRepositoryStub()), new KundeLogikk(new KundeRepositoryStub()));
            controller.ControllerContext = mock.Object;
            var resultat = (ViewResult)controller.Produkt();

            //act
            //assert
            Assert.IsTrue(resultat.ViewName == "");
        }
        public void produkt_authfeilnotlogged()
        {
            var mock = new Mock<ControllerContext>();
            mock.SetupGet(u => u.HttpContext.Request.IsAuthenticated).Returns(true);
            mock.SetupGet(u => u.HttpContext.User.Identity.Name).Returns("");

            var controller = new AdminController(new Mock<IAuth>().Object, new AdminLogikk(new ansattRepositoryStub()),
                new ProdukterLogikk(new ProduktRepositoryStub()), new KundeLogikk(new KundeRepositoryStub()));
            controller.ControllerContext = mock.Object;
            var viewResult = (RedirectToRouteResult)controller.Produkt();

            Assert.AreEqual("logginn", viewResult.RouteValues["Action"]); //<---view som blir vist hvis er requested-->)
            Assert.AreEqual("Admin", viewResult.RouteValues["Controller"]); //<---view som blir vist hvis er requested-->)
        }