Пример #1
0
        public async Task CheckoutShouldReturn404NotFound()
        {
            var basketServiceMock = new Mock <IBasketService>(MockBehavior.Strict);

            basketServiceMock.Setup(service => service.Exists(null)).ReturnsAsync(false);

            var productServiceMock = new Mock <IProductService>(MockBehavior.Strict);

            var controller = new BasketsController(basketServiceMock.Object, productServiceMock.Object);

            var result = await controller.Checkout(null, new MoneyDataContract());

            Assert.IsType <NotFoundResult>(result);

            basketServiceMock.Verify(service => service.Exists(null), Times.Once);
            basketServiceMock.VerifyAll();
        }