Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Zoo!");

            Cow       cow       = new Cow();
            BlackBear blackbear = new BlackBear();
            PolarBear polarBear = new PolarBear();
            Ostrich   ostrich   = new Ostrich();
            Goose     goose     = new Goose();
            Tortise   tortise   = new Tortise();
            Crocodile crocodile = new Crocodile();

            Console.WriteLine($"Cow: {cow.PlowField()}");
            Console.WriteLine($"Black Bear: {blackbear.ClimbTree()}");
            Console.WriteLine($"Polar Bear: {polarBear.Sleep()}");
            Console.WriteLine($"Polar Bear: {polarBear.Prey}");
            Console.WriteLine($"Polar Bear: {polarBear.HuntingGround()}");
            Console.WriteLine($"Ostrich: {ostrich.Sprint()}");
            Console.WriteLine($"Ostrich: {ostrich.Race()}");
            Console.WriteLine($"Ostrich: When I race, do I wear blinders? {ostrich.WearBlinders}");
            Console.WriteLine($"Goose: {goose.Sound()}");
            Console.WriteLine($"Tortise: {tortise.HideInShell()}");
            Console.WriteLine($"Crocodile: {crocodile.BirdTeethClean()}");
        }
Пример #2
0
        public void TortiseCanInheritHunt()
        {
            Tortise tortise = new Tortise();

            Assert.False(tortise.Hunt());
        }
Пример #3
0
        public void TortiseCanInheritSound()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("Tuuuuurtle, tuuuuuurtle.", tortise.Sound());
        }
Пример #4
0
        public void TortiseCanInheritSwim()
        {
            Tortise tortise = new Tortise();

            Assert.False(tortise.Swim());
        }
Пример #5
0
        public void TortiseCanHideInShell()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("I hide in my shell when there is danger", tortise.HideInShell());
        }
Пример #6
0
        public void TortiseCanSleep()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("ZZZ... ZZZ... ZZZ...", tortise.Sleep());
        }
Пример #7
0
        public void TortiseCanInheritEat()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("I like to eat plants!!!", tortise.Eat());
        }