예제 #1
0
        private static void TestDrink()
        {
            var juice = new Juice("Orange", "made from oranges");
            var beer  = new Beer("Budweiser", "5% alcohol");
            var soda  = new Soda("Pepsi");

            var drinks = new List <Drink>()
            {
                juice, beer, soda
            };

            drinks.ForEach(dd => {
                Console.WriteLine(dd.Description);
            });
        }
예제 #2
0
        public void TestPearJuice_FruitType_IsSame()
        {
            var juice = new Juice("Pear", "my pear juice");

            Assert.Equal("Pear", juice.Name);
        }
예제 #3
0
        public void TestGrapeJuice_Carbonated_IsFalse()
        {
            var juice = new Juice("Grape", "my grape juice");

            Assert.Equal(false, juice.IsCarbonated);
        }