Beispiel #1
0
        public async Task Delete_shouldReturnBadRequest_WhenProductIdIsNotProvided()
        {
            //Arrange
            int    customerId = 1;
            string productId  = "";

            var sut = new WishlistController(_wishlistService);

            //Act
            var result = await sut.DeleteAsync(customerId, productId);

            //Assert
            Assert.Equal((int)HttpStatusCode.BadRequest, (result as ObjectResult).StatusCode);
        }
Beispiel #2
0
        public async Task Delete_shouldReturnNotFound_WhenItIsNotPossibleToAddProduct()
        {
            //Arrange
            int    customerId = 1;
            string productId  = "1";

            _wishlistService.RemoveProductFromCustomerrWishlistAsync(customerId, productId).Returns(false);

            var sut = new WishlistController(_wishlistService);

            //Act
            var result = await sut.DeleteAsync(customerId, productId);

            //Assert
            Assert.Equal((int)HttpStatusCode.NotFound, (result as StatusCodeResult).StatusCode);
        }