Ejemplo n.º 1
0
        public void Pizza_Part_Selected_Is_Correct()
        {
            // Arrange
            string expectedName = null;

            // Act
            string actualName = new ConcretePizza().SelectTopping().Name;

            // Assert
            Assert.Equal(expectedName, actualName);
        }
Ejemplo n.º 2
0
        public void SubmitOrder(ClientOrder order, ConcretePizza pizza)
        {
            _db.Pizza.Add(new Data.Entities.Pizza {
                Crust = new Crust {
                    Name = pizza.Crust.Name, Price = pizza.Crust.Price
                },
                Size = new Size {
                    Name = pizza.Size.Name, Price = pizza.Size.Price
                },
                Price = pizza.Price
            });

            _db.SaveChanges();

            order.Pizzas.Add(pizza);
            Orders.Add(order);
        }
Ejemplo n.º 3
0
        public void Pizza_Is_Set()
        {
            // Arrange
            string  expectedCrustName   = "California";
            string  expectedSizeName    = "Small";
            string  expectedToppingName = "Onions";
            decimal expectedTotalPrice  = 6.25M;

            // Act
            ConcretePizza actualPizza       = new ConcretePizza();
            string        actualCrustName   = actualPizza.SelectCrust().Name;
            string        actualSizeName    = actualPizza.SelectSize().Name;
            string        actualToppingName = actualPizza.SelectTopping().Name;
            decimal       actualTotalPrice  = actualPizza.SelectCrust().Price + actualPizza.SelectSize().Price + actualPizza.SelectTopping().Price;

            // Assert
            Assert.Equal(expectedCrustName, actualCrustName);
            Assert.Equal(expectedSizeName, actualSizeName);
            Assert.Equal(expectedToppingName, actualToppingName);
            Assert.Equal(expectedTotalPrice, actualTotalPrice);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            ConcretePizza testPizza = new ConcretePizza();

            Console.WriteLine($"You ordered a {testPizza.Size.Name} {testPizza.Crust.Name} Style Pizza with {testPizza.Topping.Name}. Your total cost is: ${testPizza.Price}.");
        }
Ejemplo n.º 5
0
 public void CompleteOrder()
 {
     //will add current Pizza to the Order as well ask the user if they want to add additional Pizzas to the order.
     ConcretePizza pizza = new ConcretePizza();
 }