Esempio n. 1
0
        public void InitializeAppetizer_ChickenWings()
        {
            string     name              = "Chicken Wings";
            int        quantity          = 2;
            int        dinerSerialNumber = 1;
            eAppetizer appetizerType     = eAppetizer.ChickenWings;
            Appetizer  appetizer         = InitializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType);

            Assert.AreEqual(appetizerType, appetizer.AppetizerType);
            Assert.AreEqual(dinerSerialNumber, appetizer.DinerSerialNumber);
            Assert.AreEqual(DishRanks.DishesRank[eDishTypes.Appetizer], appetizer.MainRank);
            Assert.AreEqual(name, appetizer.Name);
            Assert.AreEqual(DishPrices.AppetizerPrices[appetizerType], appetizer.Price);
            Assert.AreEqual(quantity, appetizer.Quantity);
            Assert.AreEqual(1, appetizer.SecondRank);
            Assert.AreEqual(DishRanks.AppetizerRanks[appetizerType], appetizer.ThirdRank);
        }
Esempio n. 2
0
        public void OrderTests_SortOrder()
        {
            Order order = new Order();

            string    name              = "Spring Chicken";
            int       quantity          = 2;
            int       dinerSerialNumber = 1;
            eMainDish mainDishType      = eMainDish.SpringChicken;
            MainDish  mainDish2         = InitializeDishes.InitializeMainDish(name, quantity, dinerSerialNumber, mainDishType);

            order.Dishes.Add(mainDish2);


            name              = "Chicken Nuggets";
            quantity          = 2;
            dinerSerialNumber = 1;
            eAppetizer appetizerType = eAppetizer.ChickenNuggets;
            Appetizer  appetizer     = InitializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType);

            order.Dishes.Add(appetizer);

            name              = "Schnitzel";
            quantity          = 2;
            dinerSerialNumber = 1;
            mainDishType      = eMainDish.Schnitzel;
            MainDish mainDish = InitializeDishes.InitializeMainDish(name, quantity, dinerSerialNumber, mainDishType);

            order.Dishes.Add(mainDish);

            name              = "Chicken Skewers";
            quantity          = 2;
            dinerSerialNumber = 1;
            appetizerType     = eAppetizer.ChickenSkewers;
            Appetizer appetizer2 = InitializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType);

            order.Dishes.Add(appetizer2);

            order.SortOrder();

            Assert.AreEqual(order.Dishes[0].Name, appetizer.Name);
            Assert.AreEqual(order.Dishes[1].Name, appetizer2.Name);
            Assert.AreEqual(order.Dishes[2].Name, mainDish.Name);
            Assert.AreEqual(order.Dishes[3].Name, mainDish2.Name);
        }
Esempio n. 3
0
 public Appetizer(string name, int quantity, int dinerSerialNumber, eAppetizer appetizerType) : base(name, quantity, dinerSerialNumber)
 {
     AppetizerType = appetizerType;
 }
Esempio n. 4
0
        public static Appetizer InitializeAppetizer(string name, int quantity, int dinerSerialNumber, eAppetizer appetizerType)
        {
            DishBuilders.DishBuilders.AppetizerBuilder.Appetizer = new Appetizer(name, quantity, dinerSerialNumber, appetizerType);
            DishBuilders.Director.SetDishRanks(DishBuilders.DishBuilders.AppetizerBuilder);

            return(DishBuilders.DishBuilders.AppetizerBuilder.Appetizer);
        }