Esempio n. 1
0
        public void Cart_Should_Update_Amount_When_Same_Product_Is_Added_Twice()
        {
            var fixture = new ShoppingCartFixture();

            fixture.Setup();

            fixture.AddProductToCart(Xbox, 2);
            fixture.AddProductToCart(Xbox, 3);

            fixture.AssertProductIsInCart(Xbox, 5);
        }
Esempio n. 2
0
        public void Carts_Total_Should_Be_Sum_Of_Products_Price_Times_Amount()
        {
            var fixture = new ShoppingCartFixture();

            fixture.Setup();

            fixture.AddProductToCart(Playstation, 2); //500
            fixture.AddProductToCart(Xbox, 1);        //199.99

            //Assert.AreEqual(699.99, _cart.Total);
            fixture.AssertCartTotalIsCorrect(699.99);
        }
Esempio n. 3
0
        public void Cart_should_Contain_Different_Products_After_Products_Are_Added()
        {
            var fixture = new ShoppingCartFixture();

            fixture.Setup();

            fixture.AddProductToCart(Xbox, 1);
            fixture.AddProductToCart(Playstation, 2);

            fixture.AssertProductIsInCart(Xbox, 1);
            fixture.AssertProductIsInCart(Playstation, 2);
        }
Esempio n. 4
0
        public void Cart_Should_Contain_Product_After_Product_Is_Added()
        {
            var fixture = new ShoppingCartFixture();

            fixture.Setup();

            fixture.AddProductToCart(Xbox, 2);

            fixture.AssertProductIsInCart(Xbox, 2);
        }
Esempio n. 5
0
        public void User_Should_Be_Fetched_From_Repository_On_Checkout()
        {
            var fixture = new ShoppingCartFixture();

            fixture.UserConfiguration
            .WithName("Frank")
            .WithDateOfBirth(new DateTime(1978, 9, 27))
            .WithAccountNumber("1234-84");
            fixture.ShoppingCartConfiguration
            .WithUserName("Frank");

            fixture.Setup();

            fixture.AddProductToCart(Xbox, 1);
            fixture.CheckoutCart();

            fixture.VerifyUserFetched();
        }