public void CreateShampoo_WhenNameParamIsNullOrEmpty_ShouldThrowNullReferenceException(string nameParam)
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<NullReferenceException>(() => cosmeticFactory.CreateShampoo(nameParam, "example", 10.0M, GenderType.Men, 100, UsageType.EveryDay));
        }
        public void CreateCategory_WhenNameParamIsNullOrEmpty_ShouldThrowNullReferenceException(string nameParam)
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<NullReferenceException>(() => cosmeticFactory.CreateCategory(nameParam));
        }
        public void CreateShampoo_WhenBrandParamLenghtIsOutOfRange_ShouldThrowIndexOutOfRangeException(string brandParam)
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<IndexOutOfRangeException>(() => cosmeticFactory.CreateShampoo("example", brandParam, 10.0M, GenderType.Men, 100, UsageType.EveryDay));
        }
        public void TestCreateShampoo_PassValidParameters_ShouldCreateShampoo(string name, string brand)
        {
            var factory = new CosmeticsFactory();
            var shampoo = factory.CreateShampoo(name, brand, 10.0M, GenderType.Men, 100, UsageType.EveryDay);

            Assert.IsNotNull(shampoo);
            Assert.IsTrue(shampoo.Name == name);
            Assert.IsTrue(shampoo.Brand == brand);
        }
        public void TestCreateCategory_PassValidParameters_ShouldCreateCategory(string name)
        {
            var factory = new CosmeticsFactory();
            var category = factory.CreateCategory(name);

            Assert.IsNotNull(category);
            Assert.IsTrue(category.Name == name);
            Assert.IsTrue(category.GetType().Name == "Category");
        }
        public void CreateCategory_WhenNameParamIsValid_ShouldReturnInstanceOfCategory()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act
            var executionResult = cosmeticFactory.CreateCategory("Pesho");

            // Assert
            Assert.IsInstanceOf<ICategory>(executionResult);
        }
        public void CreateShampoo_WhenAllParamsAreValid_ShouldReturnInstanceOfShampoo()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act
            var executionResult = cosmeticFactory.CreateShampoo("Pesho", "example", 10.0M, GenderType.Men, 100, UsageType.EveryDay);

            // Assert
            Assert.IsInstanceOf<IShampoo>(executionResult);
        }
        public void CreateToothpaste_WhenNameParamLenghtIsOutOfRange_ShouldThrowIndexOutOfRangeException(string nameParam)
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<IndexOutOfRangeException>(() => cosmeticFactory.CreateToothpaste(nameParam, "example", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" }));
        }
        public void CreateToothpaste_WhenNameParamIsValid_ShouldReturnInstanceOfToothpaste()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act
            var executionResult = cosmeticFactory.CreateToothpaste("Gosho", "example", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" });

            // Assert
            Assert.IsInstanceOf<IToothpaste>(executionResult);
        }
        public void CreateToothpaste_WhenNameParamIsNullOrEmpty_ShouldThrowNullReferenceException(string nameParam)
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<NullReferenceException>(() => cosmeticFactory.CreateToothpaste(nameParam, "example", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" }));
        }
 public void TestCreateToothpaste_PassLongerCOmponents_ShouldThrowINdexOutOfRange(string description)
 {
     var factory = new CosmeticsFactory();
     Assert.Throws<IndexOutOfRangeException>(() => factory.CreateToothpaste("name", "brand", 10M, GenderType.Unisex, new List<string>() { description, "Chesun" }));
 }
        public void TestCreateShampoo_PassLongerName_ShouldTHrowIndexOutOfRange(string name)
        {
            var factory = new CosmeticsFactory();

            Assert.Throws<IndexOutOfRangeException>(() => factory.CreateShampoo(name, "example", 10.0M, GenderType.Men, 100, UsageType.EveryDay));
        }
        public void TestCreateShampoo_PassInvalidName_ShouldTHrowNullReferenceException(string name)
        {
            var factory = new CosmeticsFactory();

            Assert.Throws<NullReferenceException>(() => factory.CreateShampoo(name, "example", 10.0M, GenderType.Men, 100, UsageType.EveryDay));
        }
        public void TestCreateCategory_PassLongerName_ShouldTHrowIndexOutOfRange(string name)
        {
            var factory = new CosmeticsFactory();

            Assert.Throws<IndexOutOfRangeException>(() => factory.CreateCategory(name));
        }
        public void TestCreateToothpaste_PassValidParameters_ShouldCreateToothpaste(string name, string brand)
        {
            var factory = new CosmeticsFactory();
            var paste = factory.CreateToothpaste(name, brand, 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" });

            Assert.IsNotNull(paste);
            Assert.IsTrue(paste.Name == name);
            Assert.IsTrue(paste.Brand == brand);
        }
        public void TestCreateToothpaste_PassLongerName_ShouldTHrowIndexOutOfRange(string name)
        {
            var factory = new CosmeticsFactory();

            Assert.Throws<IndexOutOfRangeException>(() => factory.CreateToothpaste(name, "example", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" }));
        }
        public void TestCreateShoppingCart_ShouldInitialiseCorrectly()
        {
            var factory=new CosmeticsFactory();
            var cart = factory.CreateShoppingCart();

            Assert.IsNotNull(cart);
            Assert.IsTrue(cart.GetType().Name == "ShoppingCart");
        }
        public void CreateToothpaste_WhenIngredientsHaveInvalidLenght_ShouldThrowIndexOutOfRangeException(params string[] ingredients )
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act && Assert
            Assert.Throws<IndexOutOfRangeException>(() => cosmeticFactory.CreateToothpaste("Gosho", "example", 10M, GenderType.Unisex, ingredients.ToList()));
        }
        public void CreateShoppingCart_WhenInvoked_ShouldReturnInstanceOfShoppingCart()
        {
            // Arrange
            var cosmeticFactory = new CosmeticsFactory();

            // Act
            var executionResult = cosmeticFactory.CreateShoppingCart();

            // Assert
            Assert.IsInstanceOf<IShoppingCart>(executionResult);
        }
        public void TestCreateToothpaste_PassInvalidName_ShouldTHrowNullReferenceException(string name)
        {
            var factory = new CosmeticsFactory();

            Assert.Throws<NullReferenceException>(() => factory.CreateToothpaste(name, "example", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" }));
        }