public async Task HentEnBestillingLoggetInnOK()
        {
            var bestilling1 = new Bestilling
            {
                Id   = 4,
                pris = 200.00,
                Fra  = "Nordstrand",
                Til  = "Bergen",
                Dato = "2020-11-01",
                Tid  = "15:00"
            };

            mockRepo.Setup(k => k.HentEn(1)).ReturnsAsync(bestilling1);

            var bestillingController = new BestillingController(mockRepo.Object, mockLog.Object);

            mockSession[_loggetInn] = _loggetInn;
            mockHttpContext.Setup(s => s.Session).Returns(mockSession);
            bestillingController.ControllerContext.HttpContext = mockHttpContext.Object;

            var resultat = await bestillingController.HentEn(1) as OkObjectResult;

            Assert.Equal((int)HttpStatusCode.OK, resultat.StatusCode);
            Assert.Equal <Bestilling>(bestilling1, (Bestilling)resultat.Value);
        }
        public async Task HentEnBestillingIkkeLoggetInn()
        {
            mockRepo.Setup(k => k.HentEn(1)).ReturnsAsync(() => null);

            var bestillingController = new BestillingController(mockRepo.Object, mockLog.Object);

            mockSession[_loggetInn] = _ikkeLoggetInn;
            mockHttpContext.Setup(s => s.Session).Returns(mockSession);
            bestillingController.ControllerContext.HttpContext = mockHttpContext.Object;

            var resultat = await bestillingController.HentEn(1) as UnauthorizedObjectResult;

            Assert.Equal((int)HttpStatusCode.Unauthorized, resultat.StatusCode);
            Assert.Equal("Ikke logget inn", resultat.Value);
        }
        public async Task HentEnBestillingNotFound()
        {
            mockRepo.Setup(k => k.HentEn(1)).ReturnsAsync(() => null);

            var bestillingController = new BestillingController(mockRepo.Object, mockLog.Object);

            mockSession[_loggetInn] = _loggetInn;
            mockHttpContext.Setup(s => s.Session).Returns(mockSession);
            bestillingController.ControllerContext.HttpContext = mockHttpContext.Object;

            var resultat = await bestillingController.HentEn(1) as NotFoundObjectResult;

            Assert.Equal((int)HttpStatusCode.NotFound, resultat.StatusCode);
            Assert.Equal("Bestillingen ble ikke funnet", resultat.Value);
        }