public void Print_WhenInvoked_ShouldReturnToothpasteDetailsInValidStringFormat()
        {
            // Arrange
            var toothpaste = new Toothpaste("example", "Pesho", 10M, GenderType.Unisex, new List<string>() { "Zele", "Chesun" });

            var expectedResult = new StringBuilder();
            expectedResult.AppendLine("- Pesho - example:");
            expectedResult.AppendLine("  * Price: $10");
            expectedResult.AppendLine("  * For gender: Unisex");
            expectedResult.Append("  * Ingredients: Zele, Chesun");

            // Act
            var executionResult = toothpaste.Print();

            // Assert
            Assert.AreEqual(expectedResult.ToString(), executionResult);
        }
        public IToothpaste CreateToothpaste(string name, string brand, decimal price, GenderType gender, IList<string> ingredients)
        {
            var toothpaste = new Toothpaste(name, brand, price, gender, ingredients.ToArray());

            return toothpaste;
        }
Beispiel #3
0
 public Toothpaste CreateToothpaste(string name, string brand, decimal price, GenderType gender, IList<string> ingredients)
 {
     // TODO: create toothpaste
     Toothpaste newToothpaste = new Toothpaste(name, brand, price, gender,ingredients);
     return newToothpaste;
 }