Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            BrownBear BoBo   = new BrownBear();
            Peacock   Jane   = new Peacock();
            Goldfish  Bill   = new Goldfish();
            Salmon    Jasper = new Salmon();
            Turtle    Molly  = new Turtle();
            Snake     Kathy  = new Snake();

            Console.WriteLine("Brownbear Speaks: ");
            BoBo.Speak();

            Console.WriteLine("Peacock Sleeps: ");
            Jane.Sleep();
            Console.WriteLine("Peacock interface Play: ");
            Console.WriteLine(Jane.PlayInterface());
            Console.WriteLine("Peacock interface Potty: ");
            Console.WriteLine(Jane.PottyInterface());

            Console.WriteLine("Goldfish Moves: ");
            Bill.Move();
            Console.WriteLine("Goldfish interface Potty: ");
            Console.WriteLine(Bill.PottyInterface());

            Console.WriteLine("Salmon NumOfBabies");
            Jasper.NumOfBabies = 5;
            Console.WriteLine(Jasper.NumOfBabies);

            Console.WriteLine("Turtle HasShell: ");
            Molly.HasShell = true;
            Console.WriteLine(Molly.HasShell);
            Console.WriteLine("Turtle interface Play: ");
            Console.WriteLine(Molly.PlayInterface());

            Console.WriteLine("Snake HasSpine");
            Kathy.HasSpine = true;
            Console.WriteLine(Kathy.HasSpine);

            Console.ReadLine(); //to stop it from auto exit
        }
Ejemplo n.º 2
0
        public void TestInterfaceGoldfish2()
        {
            Goldfish Peppa = new Goldfish();

            Assert.NotEqual("blah", Peppa.PottyInterface());
        }
Ejemplo n.º 3
0
        public void TestInterfaceGoldfish1()
        {
            Goldfish Peppa = new Goldfish();

            Assert.Equal("Hello from PottyInterface IPotty Goldfish", Peppa.PottyInterface());
        }