Exemplo n.º 1
0
        public async Task AddCartAsync_ReturnsTrue()
        {
            //Arrange
            bool expected = true;
            var  cart     = new Carts()
            {
                Id = 1, CustomerId = 1, TotalPrice = 200
            };

            _cartRepostitoryMock.Setup(x => x.AddAsync(cart)).ReturnsAsync(expected);
            //Act
            var cartRes = await _cartServiceMock.AddCartAsync(cart);

            //Assert
            Assert.Equal(expected, cartRes);
            Assert.True(cartRes);
        }