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

            // ACT
            var isRemoved = cart.Remove(1);

            // ASSERT
            Assert.True(isRemoved);
            Assert.Equal(0, cart.CartItems.Count);
        }
Beispiel #2
0
        public void Test_Remove_ReturnsFalse_When_MovieSessionNotFound()
        {
            // ARRANGE
            cart = new WMoSS.Entities.Cart
            {
                CartItems = new WMoSS.Entities.CartItem[]
                {
                    new WMoSS.Entities.CartItem
                    {
                        MovieSessionId = 1,
                        TicketQuantity = 1
                    }
                }.ToList()
            };

            // ACT
            var isRemoved = cart.Remove(2);

            // ASSERT
            Assert.False(isRemoved);
            Assert.Equal(1, cart.CartItems.Count);
        }