public void Test_MushroomPrice()
        {
            // arrange
            var sut = new MushroomTopping();

            // act
            var actual = sut.Price;

            // assert
            Assert.Equal(actual, 0.6m);
        }
        public void Test_MushroomToString()
        {
            // arrange
            var sut = new MushroomTopping();

            // act
            var actual = sut.Name;

            // assert
            Assert.Equal(actual, "Mushroom");
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //Client-code
            Margherita pizza = new Margherita();

            Console.WriteLine("Plain Margherita: " + pizza.GetPrice().ToString());

            ExtraCheeseTopping moreCheese     = new ExtraCheeseTopping(pizza);
            ExtraCheeseTopping someMoreCheese = new ExtraCheeseTopping(moreCheese);

            Console.WriteLine("Plain Margherita with double extra cheese: " + someMoreCheese.GetPrice().ToString());

            MushroomTopping moreMushroom = new MushroomTopping(someMoreCheese);

            Console.WriteLine("Plain Margherita with double extra cheese with mushroom: " + moreMushroom.GetPrice().ToString());

            JalapenoTopping moreJalapeno = new JalapenoTopping(moreMushroom);

            Console.WriteLine("Plain Margherita with double extra cheese with mushroom with Jalapeno: " + moreJalapeno.GetPrice().ToString());

            Console.ReadLine();
        }
Exemplo n.º 4
0
    static void Main()
    {
        //Client-code
        Margherita pizza = new Margherita();
        Console.WriteLine("Plain Margherita: " + pizza.GetPrice().ToString());

        ExtraCheeseTopping moreCheese = new ExtraCheeseTopping(pizza);
        ExtraCheeseTopping someMoreCheese = new ExtraCheeseTopping(moreCheese);
        Console.WriteLine("Plain Margherita with double extra cheese: " + someMoreCheese.GetPrice().ToString());

        MushroomTopping moreMushroom = new MushroomTopping(someMoreCheese);
        Console.WriteLine("Plain Margherita with double extra cheese with mushroom: " + moreMushroom.GetPrice().ToString());

        JalapenoTopping moreJalapeno = new JalapenoTopping(moreMushroom);
        Console.WriteLine("Plain Margherita with double extra cheese with mushroom with Jalapeno: " + moreJalapeno.GetPrice().ToString());

        Console.ReadLine();
    }
Exemplo n.º 5
0
 public override void AddMushrooms()
 {
     Pizza = new MushroomTopping(new MushroomTopping(Pizza));
 }