Esempio n. 1
0
        public void AddCosmetics_WhenProductParamIsValid_ShouldAddProductToList()
        {
            // Arrange
            var mockedProduct = new Mock<IProduct>();
            var category = new MockedCategory("ForMale");

            // Act
            category.AddProduct(mockedProduct.Object);

            // Assert
            Assert.IsTrue(category.Products.Contains(mockedProduct.Object));
        }
Esempio n. 2
0
        public void RemoveCosmetics_WhenProductParamIsValid_ShouldRemoveProductFromList()
        {
            // Arrange
            var mockedProduct = new Mock<IProduct>();
            var category = new MockedCategory("ForMale");
            category.Products.Add(mockedProduct.Object);

            // Act
            category.RemoveProduct(mockedProduct.Object);

            // Assert
            Assert.IsFalse(category.Products.Contains(mockedProduct.Object));
        }