Ejemplo n.º 1
0
        public void SetSecondaryTypePositionAndPrice(string i_Name)
        {
            eAppetizerTypes appetizerType = ((eAppetizerTypes)Enum.Parse(typeof(eAppetizerTypes), i_Name));

            SecondaryTypePosition = appetizersTypeDictionary[appetizerType];
            Price = appetizersPriceDictionary[appetizerType];
        }
Ejemplo n.º 2
0
        public void InitializeAppetizerByAPIQuery()
        {
            string          name              = "Chicken Nuggets";
            int             quantity          = 2;
            int             dinerSerialNumber = 1;
            eAppetizerTypes appetizerType     = eAppetizerTypes.ChickenSkewers;

            DishParameters = new DishParameters()
            {
                Name = name, Quantity = quantity, DinerSerialNumber = dinerSerialNumber
            };



            RunAsync().Wait();

            //Appetizer appetizer = initializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType);

            Assert.AreEqual(appetizerType, appetizer.Type);
            Assert.AreEqual(dinerSerialNumber, appetizer.DinerSerialNumber);
            Assert.AreEqual(dishesRank.DishTypesRank[eDishTypes.Appetizer], appetizer.MainRank);
            Assert.AreEqual(name, appetizer.Name);
            Assert.AreEqual(dishesPrices.AppetizerPrices[appetizerType], appetizer.Price);
            Assert.AreEqual(quantity, appetizer.Quantity);
            Assert.AreEqual(1, appetizer.SecondRank);
            Assert.AreEqual(dishesRank.AppetizerRanks[appetizerType], appetizer.ThirdRank);
        }
Ejemplo n.º 3
0
        public void InitializeAppetizer()
        {
            //Appetizer appetizer = initializeDishes.InitializeAppetizer("chicken", 2, 1, eAppetizerTypes.ChickenNuggets);
            //Assert.AreEqual(eAppetizerTypes.ChickenNuggets, appetizer.Type);


            string          name              = "Chicken Nuggets";
            int             quantity          = 2;
            int             dinerSerialNumber = 1;
            eAppetizerTypes appetizerType     = eAppetizerTypes.ChickenNuggets;
            Appetizer       appetizer         = initializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType);

            Assert.AreEqual(appetizerType, appetizer.Type);
            Assert.AreEqual(dinerSerialNumber, appetizer.DinerSerialNumber);
            Assert.AreEqual(dishesRank.DishTypesRank[eDishTypes.Appetizer], appetizer.MainRank);
            Assert.AreEqual(name, appetizer.Name);
            Assert.AreEqual(dishesPrices.AppetizerPrices[appetizerType], appetizer.Price);
            Assert.AreEqual(quantity, appetizer.Quantity);
            Assert.AreEqual(1, appetizer.SecondRank);
            Assert.AreEqual(dishesRank.AppetizerRanks[appetizerType], appetizer.ThirdRank);
        }
Ejemplo n.º 4
0
        public Appetizer InitializeAppetizer(string name, int quantity, int dinerSerialNumber, eAppetizerTypes appetizerType)
        {
            //DishBuilder<Appetizer> dishBuilder1 = new
            AppetizerBuilder appetizerBuilder = new AppetizerBuilder();

            Appetizer appetizer = appetizerBuilder.BuildDish(name, quantity, dinerSerialNumber, appetizerType);

            return(appetizer);

            //DishBuilders.DishBuilders.AppetizerBuilder.Appetizer = new Appetizer(name, quantity, dinerSerialNumber, appetizerType);
            //DishBuilders.Director.SetDishRanks(DishBuilders.DishBuilders.AppetizerBuilder);

            //return DishBuilders.DishBuilders.AppetizerBuilder.Appetizer;
        }
Ejemplo n.º 5
0
        public Appetizer BuildDish(string name, int quantity, int dinerSerialNumber, eAppetizerTypes appetizerType)
        {
            Dish = new Appetizer(name, quantity, dinerSerialNumber, appetizerType);

            return(base.BuildDish(eDishTypes.Appetizer) as Appetizer);
        }
Ejemplo n.º 6
0
 public Appetizer(string name, int quantity, int dinerSerialNumber, eAppetizerTypes appetizerType) : base(name, quantity, dinerSerialNumber)
 {
     Type = appetizerType;
 }