예제 #1
0
        public static void SurfaceAnimals()
        {
            Console.WriteLine("Pterodactyl I am!");
            Pterodactyl pterodactyl = new Pterodactyl();

            Console.WriteLine($"Tail: {pterodactyl.Tail}.");
            Console.WriteLine($"Location: {pterodactyl.Location}.");
            Console.WriteLine($"Feed Cost:${pterodactyl.FeedCost}.");
            Console.WriteLine($"# of Eyes: {pterodactyl.Eyes}.");
            Console.WriteLine($"Are they Safe: {pterodactyl.Safe}.");
            Console.WriteLine($"Flyer: {pterodactyl.Flyer()}.");
            Console.WriteLine($"Eat: {pterodactyl.Eat()}.");
            Console.WriteLine($"Speak: {pterodactyl.Speak()}.");

            Console.WriteLine("");
            Console.WriteLine("Flying-Spider I am!");
            FlyingSpider flyingSpider = new FlyingSpider();

            Console.WriteLine($"Tail: {flyingSpider.Tail}.");
            Console.WriteLine($"Location: {flyingSpider.Location}.");
            Console.WriteLine($"Feed Cost:${flyingSpider.FeedCost}.");
            Console.WriteLine($"# of Eyes: {flyingSpider.Eyes}.");
            Console.WriteLine($"Are they Safe: {flyingSpider.Safe()}.");
            Console.WriteLine($"Flyer: {flyingSpider.Flyer()}.");
            Console.WriteLine($"Eat: {flyingSpider.Eat()}.");
            Console.WriteLine($"Speak: {flyingSpider.Speak()}.");

            //Two Interfaces here!
            Console.WriteLine("");
            Console.WriteLine("T-Rex I am!");
            TRex rex = new TRex();

            Console.WriteLine($"Tail: {rex.Tail}.");
            Console.WriteLine($"Location: {rex.Location}.");
            Console.WriteLine($"Feed Cost:${rex.FeedCost}.");
            Console.WriteLine($"# of Eyes: {rex.Eyes}.");
            Console.WriteLine($"Are they Safe: {rex.Safe}.");
            Console.WriteLine($"Walking: {rex.Walking()}.");
            Console.WriteLine($"Eat: {rex.Eat()}.");
            Console.WriteLine($"Speak: {rex.Speak()}.");
            Console.WriteLine($"Drinking: {rex.Drinking()}.");
            Console.WriteLine($"Interface => Fun Tricks: {rex.FunTricks}.");
            Console.WriteLine($"Interface => Loves Humans: {rex.lovesHumans}.");

            Console.WriteLine("");
            Console.WriteLine("Brontosaurus I am!");
            Brontosaurs brontosaurs = new Brontosaurs();

            Console.WriteLine($"Tail: {brontosaurs.Tail}.");
            Console.WriteLine($"Location: {brontosaurs.Location}.");
            Console.WriteLine($"Feed Cost:${brontosaurs.FeedCost}.");
            Console.WriteLine($"# of Eyes: {brontosaurs.Eyes}.");
            Console.WriteLine($"Are they Safe: {brontosaurs.Safe}.");
            Console.WriteLine($"Walking: {brontosaurs.Walking()}.");
            Console.WriteLine($"Eat: {brontosaurs.Eat()}.");
            Console.WriteLine($"Speak: {brontosaurs.Speak()}.");
            Console.WriteLine($"Drinking: {brontosaurs.Drinking()}.");
        }
예제 #2
0
        public void FlyingSpiderTest2FeedCost()
        {
            FlyingSpider testTwo = new FlyingSpider();

            Assert.Equal(688.25m, testTwo.FeedCost);
        }
예제 #3
0
        public void FlyingSpiderTest1Safe()
        {
            FlyingSpider testOne = new FlyingSpider();

            Assert.False(testOne.Safe());
        }