示例#1
0
        public async Task Test_CheckInvenotry_qty1_sends_ok_status()
        {
            //Arrange
            string productId = "productid";
            int    qty       = 1;

            CreateSystemUnderTest(out var mockLogger, out var mockInventoryService);
            var controller = new InventoriesController(mockLogger.Object, mockInventoryService.Object);

            mockInventoryService.Setup(i => i.CheckInvenotry(productId, qty)).ReturnsAsync(true);
            //Act
            var actual = await controller.CheckInvenotry(productId, qty);

            //Assert
            Assert.IsType <OkObjectResult>(actual);
        }