コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            BlackBear  blackBear  = new BlackBear();
            Coho       coho       = new Coho();
            GreyWolf   greyWolf   = new GreyWolf();
            LionFish   lionFish   = new LionFish();
            PinkSalmon pinkSalmon = new PinkSalmon();
            PolarBear  polarBear  = new PolarBear();



            Console.WriteLine(polarBear.Swim());
            Console.WriteLine(pinkSalmon.Eat());
            Console.WriteLine(blackBear.Nurse());
            Console.WriteLine(lionFish.Sleep());
            Console.WriteLine(greyWolf.Play());
            Console.WriteLine(coho.Migrate());

            IRun bBear = new BlackBear();

            Console.WriteLine(bBear.TopSpeed);

            Console.WriteLine(greyWolf.Run());
            Console.WriteLine(pinkSalmon.EatsBugs());
            Console.WriteLine(pinkSalmon.favoriteBug);
            Console.WriteLine(blackBear.favoriteBug);
            Console.WriteLine(blackBear.EatsBugs());
        }
コード例 #2
0
        public void LionFishInheritSwim()
        {
            LionFish lionFish = new LionFish();

            Assert.Equal("Swims in salt water", lionFish.Swim());
        }
コード例 #3
0
        public void LionFishInheritEat()
        {
            LionFish lionFish = new LionFish();

            Assert.Equal("Eats smaller fish", lionFish.Eat());
        }