コード例 #1
0
ファイル: NoAnimalTesting.cs プロジェクト: mrsantons/OOP-Zoo
        public void ScarletIbisFeeding()
        {
            //arrange
            ScarletIbis scarletIbis = new ScarletIbis();

            //act

            //assert
            Assert.True(scarletIbis.YouCanFeedMe());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mrsantons/OOP-Zoo
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Zoo");


            //create new animal array
            Animals[] animals = new Animals[6];
            Puffin    puffin  = new Puffin()
            {
                IsInZoo = true, Name = "Puff Diddy"
            };
            ScarletIbis scarletIbis = new ScarletIbis()
            {
                IsInZoo = true, Name = "Q-T Pie"
            };
            Seahorse seahorse = new Seahorse()
            {
                IsInZoo = true, Name = "Sven"
            };
            Stingray stingray = new Stingray()
            {
                IsInZoo = true, Name = "Spotty"
            };
            Koala koala = new Koala()
            {
                IsInZoo = true, Name = "George"
            };
            SnowLeopard snowLeopard = new SnowLeopard();

            //Animal Array Contains 6 animals

            //Bird
            animals[0] = puffin;
            animals[1] = scarletIbis;

            // Fish
            animals[2] = seahorse;
            animals[3] = stingray;


            // Mammals
            animals[4] = koala;
            animals[5] = snowLeopard;


            //for loop to display animals
            foreach (var t in animals)
            {
                t.DisplayCard();
            }
        }