Beispiel #1
0
        public void Test_Modify_ReturnsFalse_WhenCartIsNotModified()
        {
            // ARRANGE
            cart = new WMoSS.Entities.Cart
            {
                CartItems = new WMoSS.Entities.CartItem[]
                {
                    new WMoSS.Entities.CartItem
                    {
                        MovieSessionId = 1,
                        TicketQuantity = 1
                    }
                }
            };

            // ACT
            var isModified = cart.Modify(2, new WMoSS.Entities.CartItem
            {
                MovieSessionId = 2,
                TicketQuantity = 2
            });

            // ASSERT
            Assert.False(isModified);
            Assert.Equal(1, cart.CartItems.First().TicketQuantity);
        }
Beispiel #2
0
        public void Test_Modify()
        {
            // ARRANGE
            cart = new WMoSS.Entities.Cart
            {
                CartItems = new WMoSS.Entities.CartItem[]
                {
                    new WMoSS.Entities.CartItem
                    {
                        MovieSessionId = 1,
                        TicketQuantity = 1
                    }
                }
            };

            // ACT
            var isModified = cart.Modify(1, new WMoSS.Entities.CartItem
            {
                MovieSessionId = 1,
                TicketQuantity = 2
            });

            // ASSERT
            Assert.True(isModified);
            Assert.Equal(2, cart.CartItems.First().TicketQuantity);
        }