示例#1
0
文件: Program.cs 项目: mikefili/Zoo
        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
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanInheritHunt()
        {
            Tortise tortise = new Tortise();

            Assert.False(tortise.Hunt());
        }
示例#3
0
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanInheritSound()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("Tuuuuurtle, tuuuuuurtle.", tortise.Sound());
        }
示例#4
0
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanInheritSwim()
        {
            Tortise tortise = new Tortise();

            Assert.False(tortise.Swim());
        }
示例#5
0
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanHideInShell()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("I hide in my shell when there is danger", tortise.HideInShell());
        }
示例#6
0
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanSleep()
        {
            Tortise tortise = new Tortise();

            Assert.Equal("ZZZ... ZZZ... ZZZ...", tortise.Sleep());
        }
示例#7
0
文件: UnitTest1.cs 项目: mikefili/Zoo
        public void TortiseCanInheritEat()
        {
            Tortise tortise = new Tortise();

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