Exemplo n.º 1
0
        public void Remove_ShouldRemoveAnItemByCartID()
        {
            //Arrange
            var shoppingCart = new ShoppingCart();
            //Act
            shoppingCart.AddItem(StubCartItem(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, 1000, CartItemType.Jewelry));
            shoppingCart.AddItem(StubCartItem(1112, 3000, CartItemType.Jewelry));

            shoppingCart.Remove(1);

            //Assert
            shoppingCart.Items.Should().HaveCount(1);
        }
Exemplo n.º 2
0
        public void Remove_ShouldRemoveAnItemByCartIDAndRecalcualtePrice()
        {
            //Arrange
            var shoppingCart = new ShoppingCart();
            //Act
            shoppingCart.AddItem(StubCartItem(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID, 1000, CartItemType.Jewelry));
            shoppingCart.AddItem(StubCartItem(1112, 3000, CartItemType.Jewelry));

            shoppingCart.Remove(1);

            //Assert
            shoppingCart.TotalPrice.Should().Be(4000-3000);
        }