public void ShouldReturnCorrectSpecialInstructions()
        {
            var    EWE = new EbonyWarriorEntourage();
            Entree e   = new BriarheartBurger();
            Side   s   = new VokunSalad();
            Drink  d   = new WarriorWater();

            List <string> expectedSpecialInstructions = new List <string>();

            expectedSpecialInstructions.Add(e.ToString());
            expectedSpecialInstructions.AddRange(e.SpecialInstructions);
            expectedSpecialInstructions.Add(s.ToString());
            expectedSpecialInstructions.AddRange(s.SpecialInstructions);
            expectedSpecialInstructions.Add(d.ToString());
            expectedSpecialInstructions.AddRange(d.SpecialInstructions);

            EWE.Entree = e;
            EWE.Side   = s;
            EWE.Drink  = d;

            foreach (string str in EWE.SpecialInstructions)
            {
                Assert.Contains(str, expectedSpecialInstructions);
            }
        }
예제 #2
0
        public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
        {
            VokunSalad vs = new VokunSalad();

            vs.Size = size;
            Assert.Equal(name, vs.ToString());
        }
        void SidesListShouldReturnCorrectList(Size size)
        {
            List <IOrderItem> sides = Menu.Sides();

            Assert.Contains(sides, item =>
            {
                VokunSalad v = new VokunSalad();
                v.Size       = size;
                return(item.ToString().Equals(v.ToString()));
            });

            Assert.Contains(sides, item =>
            {
                MadOtarGrits m = new MadOtarGrits();
                m.Size         = size;
                return(item.ToString().Equals(m.ToString()));
            });

            Assert.Contains(sides, item =>
            {
                DragonbornWaffleFries d = new DragonbornWaffleFries();
                d.Size = size;
                return(item.ToString().Equals(d.ToString()));
            });

            Assert.Contains(sides, item =>
            {
                FriedMiraak f = new FriedMiraak();
                f.Size        = size;
                return(item.ToString().Equals(f.ToString()));
            });

            Assert.Equal(12, sides.Count);
        }
예제 #4
0
        public void ChangingSizeNotifiesSideProperty()
        {
            var   combo = new Combo();
            var   side  = new VokunSalad();
            Combo old   = combo;

            combo.Side = side;

            Assert.PropertyChanged(combo, "Side", () =>
            {
                combo.Side = side;
            });
            Assert.PropertyChanged(combo, "Price", () =>
            {
                Assert.True(combo.Price == old.Price + side.Price);
            });
            Assert.PropertyChanged(combo, "Calories", () =>
            {
                Assert.True(combo.Calories == old.Calories + side.Calories);
            });
            Assert.PropertyChanged(combo, "SpecialInstructions", () =>
            {
                old.SpecialInstructions.Add(side.ToString());
                foreach (var item in side.SpecialInstructions)
                {
                    old.SpecialInstructions.Add(item);
                }
                Assert.Equal(old.SpecialInstructions, combo.SpecialInstructions);
            });
        }
예제 #5
0
        public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
        {
            VokunSalad vokunSalad = new VokunSalad();

            vokunSalad.Size = size;
            Assert.Equal(vokunSalad.ToString(), name);
        }
        void FullMenuShouldHaveAllSides(Size size)
        {
            List <IOrderItem> fullMenu = Menu.FullMenu();

            Assert.Contains(fullMenu, item =>
            {
                VokunSalad v = new VokunSalad();
                v.Size       = size;
                return(item.ToString().Equals(v.ToString()));
            });

            Assert.Contains(fullMenu, item =>
            {
                MadOtarGrits m = new MadOtarGrits();
                m.Size         = size;
                return(item.ToString().Equals(m.ToString()));
            });

            Assert.Contains(fullMenu, item =>
            {
                DragonbornWaffleFries d = new DragonbornWaffleFries();
                d.Size = size;
                return(item.ToString().Equals(d.ToString()));
            });

            Assert.Contains(fullMenu, item =>
            {
                FriedMiraak f = new FriedMiraak();
                f.Size        = size;
                return(item.ToString().Equals(f.ToString()));
            });
        }
예제 #7
0
        public void WrongSizeShouldThrowException()
        {
            VokunSalad vs = new VokunSalad();

            vs.Size = (Size)(int.MaxValue);
            Assert.Throws <System.NotImplementedException>(() => vs.Calories);
            Assert.Throws <System.NotImplementedException>(() => vs.Price);
            Assert.Throws <System.NotImplementedException>(() => vs.ToString());
        }
예제 #8
0
        public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
        {
            var VS = new VokunSalad()
            {
                Size = size
            };

            Assert.Equal(VS.ToString(), name);
        }
예제 #9
0
        public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
        {
            VokunSalad item = new VokunSalad()
            {
                Size = size
            };

            Assert.Equal(name, item.ToString());
        }
예제 #10
0
        public void ShouldReturnCorrectNameBasedOnSize(Size size)
        {
            var VS = new VokunSalad()
            {
                Size = size
            };

            if (size == Size.Small)
            {
                Assert.Equal("Small Vokun Salad", VS.ToString());
            }
            if (size == Size.Medium)
            {
                Assert.Equal("Medium Vokun Salad", VS.ToString());
            }
            if (size == Size.Large)
            {
                Assert.Equal("Large Vokun Salad", VS.ToString());
            }
        }
예제 #11
0
        public void ShouldGetAllSides()
        {
            DragonbornWaffleFries smallFries  = new DragonbornWaffleFries();
            DragonbornWaffleFries mediumFries = new DragonbornWaffleFries();

            mediumFries.Size = Size.Medium;
            DragonbornWaffleFries largeFries = new DragonbornWaffleFries();

            largeFries.Size = Size.Large;
            FriedMiraak smallMiraak  = new FriedMiraak();
            FriedMiraak mediumMiraak = new FriedMiraak();

            mediumMiraak.Size = Size.Medium;
            FriedMiraak largeMiraak = new FriedMiraak();

            largeMiraak.Size = Size.Large;
            MadOtarGrits smallGrits  = new MadOtarGrits();
            MadOtarGrits mediumGrits = new MadOtarGrits();

            mediumGrits.Size = Size.Medium;
            MadOtarGrits largeGrits = new MadOtarGrits();

            largeGrits.Size = Size.Large;
            VokunSalad smallSalad  = new VokunSalad();
            VokunSalad mediumSalad = new VokunSalad();

            mediumSalad.Size = Size.Medium;
            VokunSalad largeSalad = new VokunSalad();

            largeSalad.Size = Size.Large;
            Assert.Collection <IOrderItem>(Menu.Sides(),
                                           item => Assert.Equal(item.ToString(), smallFries.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumFries.ToString()),
                                           item => Assert.Equal(item.ToString(), largeFries.ToString()),
                                           item => Assert.Equal(item.ToString(), smallMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), largeMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), smallGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), largeGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), smallSalad.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumSalad.ToString()),
                                           item => Assert.Equal(item.ToString(), largeSalad.ToString()));
        }
예제 #12
0
        public void NameShouldReturnToString()
        {
            VokunSalad x = new VokunSalad();

            Assert.Equal(x.ToString(), x.Name);
        }
예제 #13
0
        public void ShouldHaveCorrectNameByDefault()
        {
            VokunSalad v = new VokunSalad();

            Assert.Equal(v.ToString(), v.Name);
        }
예제 #14
0
        public void ShouldGetFullMenu()
        {
            BriarheartBurger      bb          = new BriarheartBurger();
            DoubleDraugr          dd          = new DoubleDraugr();
            GardenOrcOmelette     goo         = new GardenOrcOmelette();
            PhillyPoacher         pp          = new PhillyPoacher();
            SmokehouseSkeleton    ss          = new SmokehouseSkeleton();
            ThalmorTriple         tt          = new ThalmorTriple();
            ThugsTBone            ttb         = new ThugsTBone();
            DragonbornWaffleFries smallFries  = new DragonbornWaffleFries();
            DragonbornWaffleFries mediumFries = new DragonbornWaffleFries();

            mediumFries.Size = Size.Medium;
            DragonbornWaffleFries largeFries = new DragonbornWaffleFries();

            largeFries.Size = Size.Large;
            FriedMiraak smallMiraak  = new FriedMiraak();
            FriedMiraak mediumMiraak = new FriedMiraak();

            mediumMiraak.Size = Size.Medium;
            FriedMiraak largeMiraak = new FriedMiraak();

            largeMiraak.Size = Size.Large;
            MadOtarGrits smallGrits  = new MadOtarGrits();
            MadOtarGrits mediumGrits = new MadOtarGrits();

            mediumGrits.Size = Size.Medium;
            MadOtarGrits largeGrits = new MadOtarGrits();

            largeGrits.Size = Size.Large;
            VokunSalad smallSalad  = new VokunSalad();
            VokunSalad mediumSalad = new VokunSalad();

            mediumSalad.Size = Size.Medium;
            VokunSalad largeSalad = new VokunSalad();

            largeSalad.Size = Size.Large;
            AretinoAppleJuice smallJuice  = new AretinoAppleJuice();
            AretinoAppleJuice mediumJuice = new AretinoAppleJuice();

            mediumJuice.Size = Size.Medium;
            AretinoAppleJuice largeJuice = new AretinoAppleJuice();

            largeJuice.Size = Size.Large;
            CandlehearthCoffee smallCoffee  = new CandlehearthCoffee();
            CandlehearthCoffee mediumCoffee = new CandlehearthCoffee();

            mediumCoffee.Size = Size.Medium;
            CandlehearthCoffee largeCoffee = new CandlehearthCoffee();

            largeCoffee.Size = Size.Large;
            CandlehearthCoffee smallDecafCoffee = new CandlehearthCoffee();

            smallDecafCoffee.Decaf = true;
            CandlehearthCoffee mediumDecafCoffee = new CandlehearthCoffee();

            mediumDecafCoffee.Size  = Size.Medium;
            mediumDecafCoffee.Decaf = true;
            CandlehearthCoffee largeDecafCoffee = new CandlehearthCoffee();

            largeDecafCoffee.Size  = Size.Large;
            largeDecafCoffee.Decaf = true;
            MarkarthMilk smallMilk  = new MarkarthMilk();
            MarkarthMilk mediumMilk = new MarkarthMilk();

            mediumMilk.Size = Size.Medium;
            MarkarthMilk largeMilk = new MarkarthMilk();

            largeMilk.Size = Size.Large;
            SailorSoda smallCherrySoda  = new SailorSoda();
            SailorSoda mediumCherrySoda = new SailorSoda();

            mediumCherrySoda.Size = Size.Medium;
            SailorSoda largeCherrySoda = new SailorSoda();

            largeCherrySoda.Size = Size.Large;
            SailorSoda smallBerrySoda = new SailorSoda();

            smallBerrySoda.Flavor = SodaFlavor.Blackberry;
            SailorSoda mediumBerrySoda = new SailorSoda();

            mediumBerrySoda.Size   = Size.Medium;
            mediumBerrySoda.Flavor = SodaFlavor.Blackberry;
            SailorSoda largeBerrySoda = new SailorSoda();

            largeBerrySoda.Size   = Size.Large;
            largeBerrySoda.Flavor = SodaFlavor.Blackberry;
            SailorSoda smallFruitSoda = new SailorSoda();

            smallFruitSoda.Flavor = SodaFlavor.Grapefruit;
            SailorSoda mediumFruitSoda = new SailorSoda();

            mediumFruitSoda.Size   = Size.Medium;
            mediumFruitSoda.Flavor = SodaFlavor.Grapefruit;
            SailorSoda largeFruitSoda = new SailorSoda();

            largeFruitSoda.Size   = Size.Large;
            largeFruitSoda.Flavor = SodaFlavor.Grapefruit;
            SailorSoda smallLemonSoda = new SailorSoda();

            smallLemonSoda.Flavor = SodaFlavor.Lemon;
            SailorSoda mediumLemonSoda = new SailorSoda();

            mediumLemonSoda.Size   = Size.Medium;
            mediumLemonSoda.Flavor = SodaFlavor.Lemon;
            SailorSoda largeLemonSoda = new SailorSoda();

            largeLemonSoda.Size   = Size.Large;
            largeLemonSoda.Flavor = SodaFlavor.Lemon;
            SailorSoda smallPeachSoda = new SailorSoda();

            smallPeachSoda.Flavor = SodaFlavor.Peach;
            SailorSoda mediumPeachSoda = new SailorSoda();

            mediumPeachSoda.Size   = Size.Medium;
            mediumPeachSoda.Flavor = SodaFlavor.Peach;
            SailorSoda largePeachSoda = new SailorSoda();

            largePeachSoda.Size   = Size.Large;
            largePeachSoda.Flavor = SodaFlavor.Peach;
            SailorSoda smallMelonSoda = new SailorSoda();

            smallMelonSoda.Flavor = SodaFlavor.Watermelon;
            SailorSoda mediumMelonSoda = new SailorSoda();

            mediumMelonSoda.Size   = Size.Medium;
            mediumMelonSoda.Flavor = SodaFlavor.Watermelon;
            SailorSoda largeMelonSoda = new SailorSoda();

            largeMelonSoda.Size   = Size.Large;
            largeMelonSoda.Flavor = SodaFlavor.Watermelon;
            WarriorWater smallWater  = new WarriorWater();
            WarriorWater mediumWater = new WarriorWater();

            mediumWater.Size = Size.Medium;
            WarriorWater largeWater = new WarriorWater();

            largeWater.Size = Size.Large;
            Assert.Collection <IOrderItem>(Menu.FullMenu(),
                                           item => Assert.Equal(item.ToString(), bb.ToString()),
                                           item => Assert.Equal(item.ToString(), dd.ToString()),
                                           item => Assert.Equal(item.ToString(), goo.ToString()),
                                           item => Assert.Equal(item.ToString(), pp.ToString()),
                                           item => Assert.Equal(item.ToString(), ss.ToString()),
                                           item => Assert.Equal(item.ToString(), tt.ToString()),
                                           item => Assert.Equal(item.ToString(), ttb.ToString()),
                                           item => Assert.Equal(item.ToString(), smallFries.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumFries.ToString()),
                                           item => Assert.Equal(item.ToString(), largeFries.ToString()),
                                           item => Assert.Equal(item.ToString(), smallMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), largeMiraak.ToString()),
                                           item => Assert.Equal(item.ToString(), smallGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), largeGrits.ToString()),
                                           item => Assert.Equal(item.ToString(), smallSalad.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumSalad.ToString()),
                                           item => Assert.Equal(item.ToString(), largeSalad.ToString()),
                                           item => Assert.Equal(item.ToString(), smallJuice.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumJuice.ToString()),
                                           item => Assert.Equal(item.ToString(), largeJuice.ToString()),
                                           item => Assert.Equal(item.ToString(), smallCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), largeCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), smallDecafCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumDecafCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), largeDecafCoffee.ToString()),
                                           item => Assert.Equal(item.ToString(), smallMilk.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumMilk.ToString()),
                                           item => Assert.Equal(item.ToString(), largeMilk.ToString()),
                                           item => Assert.Equal(item.ToString(), smallCherrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumCherrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largeCherrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallBerrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumBerrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largeBerrySoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallFruitSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumFruitSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largeFruitSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallLemonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumLemonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largeLemonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallPeachSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumPeachSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largePeachSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallMelonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumMelonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), largeMelonSoda.ToString()),
                                           item => Assert.Equal(item.ToString(), smallWater.ToString()),
                                           item => Assert.Equal(item.ToString(), mediumWater.ToString()),
                                           item => Assert.Equal(item.ToString(), largeWater.ToString()));
        }
예제 #15
0
        public void MenuContainsAllMenuItems()
        {
            BriarheartBurger   bb  = new BriarheartBurger();
            DoubleDraugr       db  = new DoubleDraugr();
            GardenOrcOmelette  goo = new GardenOrcOmelette();
            PhillyPoacher      pp  = new PhillyPoacher();
            SmokehouseSkeleton ss  = new SmokehouseSkeleton();
            ThalmorTriple      tt  = new ThalmorTriple();
            ThugsT_Bone        ttb = new ThugsT_Bone();

            AretinoAppleJuice aj0 = new AretinoAppleJuice()
            {
                Size = Size.Small
            };
            AretinoAppleJuice aj1 = new AretinoAppleJuice()
            {
                Size = Size.Medium
            };
            AretinoAppleJuice aj2 = new AretinoAppleJuice()
            {
                Size = Size.Large
            };
            MarkarthMilk mm0 = new MarkarthMilk()
            {
                Size = Size.Small
            };
            MarkarthMilk mm1 = new MarkarthMilk()
            {
                Size = Size.Medium
            };
            MarkarthMilk mm2 = new MarkarthMilk()
            {
                Size = Size.Large
            };
            CandlehearthCoffee chc0 = new CandlehearthCoffee()
            {
                Size = Size.Small
            };
            CandlehearthCoffee chc1 = new CandlehearthCoffee()
            {
                Size = Size.Medium
            };
            CandlehearthCoffee chc2 = new CandlehearthCoffee()
            {
                Size = Size.Large
            };
            WarriorWater ww0 = new WarriorWater()
            {
                Size = Size.Small
            };
            WarriorWater ww1 = new WarriorWater()
            {
                Size = Size.Medium
            };
            WarriorWater ww2 = new WarriorWater()
            {
                Size = Size.Large
            };
            SailorSoda ss0 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Blackberry
            };
            SailorSoda ss1 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Blackberry
            };
            SailorSoda ss2 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Blackberry
            };
            SailorSoda ss3 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Cherry
            };
            SailorSoda ss4 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Cherry
            };
            SailorSoda ss5 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Cherry
            };
            SailorSoda ss6 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Grapefruit
            };
            SailorSoda ss7 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Grapefruit
            };
            SailorSoda ss8 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Grapefruit
            };
            SailorSoda ss9 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Lemon
            };
            SailorSoda ss10 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Lemon
            };
            SailorSoda ss11 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Lemon
            };
            SailorSoda ss12 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Peach
            };
            SailorSoda ss13 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Peach
            };
            SailorSoda ss14 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Peach
            };
            SailorSoda ss15 = new SailorSoda()
            {
                Size = Size.Small, SodaFlavor = Flavor.Watermelon
            };
            SailorSoda ss16 = new SailorSoda()
            {
                Size = Size.Medium, SodaFlavor = Flavor.Watermelon
            };
            SailorSoda ss17 = new SailorSoda()
            {
                Size = Size.Large, SodaFlavor = Flavor.Watermelon
            };

            DragonbornWaffleFries df0 = new DragonbornWaffleFries()
            {
                Size = Size.Small
            };
            DragonbornWaffleFries df1 = new DragonbornWaffleFries()
            {
                Size = Size.Medium
            };
            DragonbornWaffleFries df2 = new DragonbornWaffleFries()
            {
                Size = Size.Large
            };
            FriedMiraak fm0 = new FriedMiraak()
            {
                Size = Size.Small
            };
            FriedMiraak fm1 = new FriedMiraak()
            {
                Size = Size.Medium
            };
            FriedMiraak fm2 = new FriedMiraak()
            {
                Size = Size.Large
            };
            MadOtarGrits mog0 = new MadOtarGrits()
            {
                Size = Size.Small
            };
            MadOtarGrits mog1 = new MadOtarGrits()
            {
                Size = Size.Medium
            };
            MadOtarGrits mog2 = new MadOtarGrits()
            {
                Size = Size.Large
            };
            VokunSalad vs0 = new VokunSalad()
            {
                Size = Size.Small
            };
            VokunSalad vs1 = new VokunSalad()
            {
                Size = Size.Medium
            };
            VokunSalad vs2 = new VokunSalad()
            {
                Size = Size.Large
            };

            List <IOrderItem> menu = (List <IOrderItem>)Menu.FullMenu();

            foreach (IOrderItem item in menu)
            {
                Assert.Contains(menu, item => item.ToString().Equals(bb.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(db.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(goo.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(pp.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(tt.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ttb.ToString()));

                Assert.Contains(menu, item => item.ToString().Equals(aj0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(aj1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(aj2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(chc0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(chc1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(chc2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mm0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mm1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mm2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ww0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ww1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ww2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss3.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss4.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss5.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss6.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss7.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss8.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss9.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss10.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss11.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss12.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss13.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss14.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss15.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss16.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(ss17.ToString()));

                Assert.Contains(menu, item => item.ToString().Equals(df0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(df1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(df2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(fm0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(fm1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(fm2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mog0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mog1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(mog2.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(vs0.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(vs1.ToString()));
                Assert.Contains(menu, item => item.ToString().Equals(vs2.ToString()));
            }
        }
예제 #16
0
        public void SideListContainsAllSides()
        {
            DragonbornWaffleFries df0 = new DragonbornWaffleFries()
            {
                Size = Size.Small
            };
            DragonbornWaffleFries df1 = new DragonbornWaffleFries()
            {
                Size = Size.Medium
            };
            DragonbornWaffleFries df2 = new DragonbornWaffleFries()
            {
                Size = Size.Large
            };
            FriedMiraak fm0 = new FriedMiraak()
            {
                Size = Size.Small
            };
            FriedMiraak fm1 = new FriedMiraak()
            {
                Size = Size.Medium
            };
            FriedMiraak fm2 = new FriedMiraak()
            {
                Size = Size.Large
            };
            MadOtarGrits mog0 = new MadOtarGrits()
            {
                Size = Size.Small
            };
            MadOtarGrits mog1 = new MadOtarGrits()
            {
                Size = Size.Medium
            };
            MadOtarGrits mog2 = new MadOtarGrits()
            {
                Size = Size.Large
            };
            VokunSalad vs0 = new VokunSalad()
            {
                Size = Size.Small
            };
            VokunSalad vs1 = new VokunSalad()
            {
                Size = Size.Medium
            };
            VokunSalad vs2 = new VokunSalad()
            {
                Size = Size.Large
            };

            List <IOrderItem> sideList = (List <IOrderItem>)Menu.Sides();

            foreach (IOrderItem item in sideList)
            {
                Assert.Contains(sideList, item => item.ToString().Equals(df0.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(df1.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(df2.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(fm0.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(fm1.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(fm2.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(mog0.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(mog1.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(mog2.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(vs0.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(vs1.ToString()));
                Assert.Contains(sideList, item => item.ToString().Equals(vs2.ToString()));
            }
        }
예제 #17
0
 public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
 {
     side.Size = size;
     Assert.Equal(name, side.ToString());
 }
예제 #18
0
        public void NamePropertyGetsToString()
        {
            VokunSalad bb = new VokunSalad();

            Assert.Equal(bb.ToString(), bb.Name);
        }
예제 #19
0
        public void ReturnsRightPriceCaloriesToStringAndInstructions()
        {
            ComboMeal CM = new ComboMeal();

            for (int i = 0; i < 7; i++)
            {
                Entree iItem = new BriarheartBurger();
                switch (i)
                {
                case 0:
                    iItem = new BriarheartBurger();
                    break;

                case 1:
                    iItem = new DoubleDraugr();
                    break;

                case 2:
                    iItem = new GardenOrcOmelette();
                    break;

                case 3:
                    iItem = new PhillyPoacher();
                    break;

                case 4:
                    iItem = new SmokehouseSkeleton();
                    break;

                case 5:
                    iItem = new ThalmorTriple();
                    break;

                case 6:
                    iItem = new ThugsTBone();
                    break;
                }

                for (int j = 0; j < 4; j++)
                {
                    Side jItem = new DragonbornWaffleFries();
                    switch (j)
                    {
                    case 0:
                        jItem = new DragonbornWaffleFries();
                        break;

                    case 1:
                        jItem = new FriedMiraak();
                        break;

                    case 2:
                        jItem = new MadOtarGrits();
                        break;

                    case 3:
                        jItem = new VokunSalad();
                        break;
                    }
                    foreach (Size s in (Size[])Enum.GetValues(typeof(Size)))
                    {
                        jItem.Size = s;

                        for (int k = 0; k < 5; k++)
                        {
                            Drink kItem = new SailorSoda();
                            switch (k)
                            {
                            case 0:
                                kItem = new AretinoAppleJuice();
                                break;

                            case 1:
                                kItem = new CandlehearthCoffee();
                                break;

                            case 2:
                                kItem = new MarkarthMilk();
                                break;

                            case 3:
                                kItem = new SailorSoda();
                                break;

                            case 4:
                                kItem = new WarriorWater();
                                break;
                            }

                            foreach (Size ss in (Size[])Enum.GetValues(typeof(Size)))
                            {
                                kItem.Size = ss;
                                if (kItem is SailorSoda)
                                {
                                    foreach (SodaFlavor f in (SodaFlavor[])Enum.GetValues(typeof(SodaFlavor)))
                                    {
                                        ((SailorSoda)kItem).Flavor = f;

                                        List <string> e = new List <string>();
                                        e.Add(iItem.ToString());
                                        List <string> sid = new List <string>();
                                        sid.Add(jItem.ToString());
                                        List <string> d = new List <string>();
                                        d.Add(kItem.ToString());

                                        CM.Entree = iItem;
                                        CM.Side   = jItem;
                                        CM.Drink  = kItem;

                                        Assert.Equal(iItem.Price + jItem.Price + kItem.Price - 1, CM.Price);
                                        Assert.Equal(iItem.Calories + jItem.Calories + kItem.Calories, CM.Calories);

                                        List <string> SpecialInstructions = (iItem.SpecialInstructions).Concat((jItem.SpecialInstructions).Concat((kItem.SpecialInstructions))).ToList();
                                        Assert.Equal(SpecialInstructions, CM.SpecialInstructions);
                                        Assert.Equal(iItem.ToString() + "\n" + jItem.ToString() + "\n" + kItem.ToString(), CM.ToString());
                                    }
                                }
                                else
                                {
                                    List <string> e = new List <string>();
                                    e.Add(iItem.ToString());
                                    List <string> sid = new List <string>();
                                    sid.Add(jItem.ToString());
                                    List <string> d = new List <string>();
                                    d.Add(kItem.ToString());

                                    CM.Entree = iItem;
                                    CM.Side   = jItem;
                                    CM.Drink  = kItem;

                                    Assert.Equal(iItem.Price + jItem.Price + kItem.Price - 1, CM.Price);
                                    Assert.Equal(iItem.Calories + jItem.Calories + kItem.Calories, CM.Calories);

                                    List <string> SpecialInstructions = (iItem.SpecialInstructions).Concat((jItem.SpecialInstructions).Concat((kItem.SpecialInstructions))).ToList();
                                    Assert.Equal(SpecialInstructions, CM.SpecialInstructions);
                                    Assert.Equal(iItem.ToString() + "\n" + jItem.ToString() + "\n" + kItem.ToString(), CM.ToString());
                                }
                            }
                        }
                    }
                }
            }
        }