コード例 #1
0
        public void CanGetTheCurrentPriceOfPizza()
        {
            SmallPizza smallPizza = new SmallPizza();

            smallPizza.AddTopping(new Mushrooms());
            Assert.AreEqual(990, smallPizza.Price());

            MediumPizza mediumPizza = new MediumPizza();

            mediumPizza.AddTopping(new Mushrooms());
            Assert.AreEqual(1725, mediumPizza.Price());

            LargePizza largePizza = new LargePizza();

            largePizza.AddTopping(new Mushrooms());
            Assert.AreEqual(2124, largePizza.Price());
        }
コード例 #2
0
        public void TopingsCanBeAdded()
        {
            SmallPizza smallPizza = new SmallPizza();

            smallPizza.AddTopping(new Mushrooms());
            Assert.Pass();

            MediumPizza mediumPizza = new MediumPizza();

            mediumPizza.AddTopping(new Mushrooms());
            Assert.Pass();

            LargePizza largePizza = new LargePizza();

            largePizza.AddTopping(new Mushrooms());
            Assert.Pass();
        }