Esempio n. 1
0
        public void Shopping_Cart_Add_New_Item()
        {
            //Arrange
            var mockStrategy  = new Mock <IDeliveryStrategy>();
            var context       = new ShoppingCartContext(mockStrategy.Object);
            var expectedCount = 1;

            //Act
            context.AddItem(new Product("tv", new Category("electronics"), 30, 1));

            //Assert
            Assert.Equal(expectedCount, context.GetItemCount());
        }