public void ShouldAddTopping(string topping)
        {
            var result = new PizzaBuilder().WithTopping(topping).Build();

            Assert.IsTrue(result.Toppings.SequenceEqual(new List <string>()
            {
                topping
            }));
        }
        public void ShouldAddMultipleToppings(string topping1, string topping2, string topping3)
        {
            var result = new PizzaBuilder()
                         .WithTopping(topping1)
                         .WithTopping(topping2)
                         .WithTopping(topping3)
                         .Build();

            Assert.IsTrue(result.Toppings.SequenceEqual(new List <string>()
            {
                topping1, topping2, topping3
            }));
        }
        public void ShoulBuildPizza()
        {
            var result = new PizzaBuilder()
                         .WithCrust("Thin")
                         .WithSauce("Red")
                         .WithTopping("Sausage")
                         .WithTopping("Pepperoni")
                         .Build();

            Assert.AreEqual(result.Crust, "Thin");
            Assert.AreEqual(result.Sauce, "Red");
            Assert.IsTrue(result.Toppings.SequenceEqual(new List <string>()
            {
                "Sausage", "Pepperoni"
            }));
        }
        public void ShouldSetSauce(string sauce)
        {
            var result = new PizzaBuilder().WithSauce(sauce).Build();

            Assert.AreEqual(result.Sauce, sauce);
        }
        public void ShouldSetCrust(string crust)
        {
            var result = new PizzaBuilder().WithCrust(crust).Build();

            Assert.AreEqual(result.Crust, crust);
        }
Esempio n. 6
0
 public Pizza Construct(PizzaBuilder pizzaBuilder)
 {
     return(pizzaBuilder);
 }