Beispiel #1
0
        public async Task LagBestillingIkkeOK()
        {
            mockRep.Setup(s => s.LagBestilling(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())).ReturnsAsync(false);

            var BestillingController = new BestillingController(mockRep.Object, mockLog.Object);

            //Act
            var resultat = await BestillingController.LagBestilling(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>()) as BadRequestObjectResult;

            //Assert
            Assert.Equal((int)HttpStatusCode.BadRequest, resultat.StatusCode);
            Assert.Equal("Bestilling ble ikke opprettet", resultat.Value);
        }