public void ShouldReturnEatInHerbivorelevel() { Panda panda = new Panda(); var result = panda.Eat(); Assert.Equal("I eat vegetable", result); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); //created a new object of Tiger ,Teddy is a Tiger Tiger tiger = new Tiger(); string name = tiger.Speak("Ted"); Console.WriteLine($"Hello,my name is {name}, i am a tiger"); Console.WriteLine("My color is:" + tiger.color); Console.WriteLine($"I have { tiger.legs} legs"); tiger.Eat(); tiger.Sleep(); Console.WriteLine("**************"); //created a panda object Panda panda = new Panda(); panda.name = "Sunshine"; Console.WriteLine($"Hi! I am a panda my name is {panda.name}"); panda.Eat(); panda.Sleep(); Console.WriteLine("**************"); //created a Monkey object Monkey monkey = new Monkey(); monkey.name = "King"; Console.WriteLine($"Hi! I am a monkey my name is {monkey.name}"); monkey.Eat(); monkey.Sleep(); Console.WriteLine("**************"); //created a Tutle object Turtle turtle = new Turtle(); turtle.shell = 1; turtle.name = "Alex"; Console.WriteLine($"Hi I am turtle,my name is {turtle.name} and i have {turtle.shell} shell"); turtle.Eat(); turtle.Move(); Console.WriteLine(turtle.ControlBodyTemperature()); turtle.Sleep(); Console.WriteLine("**************"); //created a Owl object Owl owl = new Owl(); owl.Sleep(); owl.Eat(); owl.sound(); Console.WriteLine("I can fly:" + owl.fly()); Console.WriteLine("**************"); //created a Ostrich object Ostrich ostrich = new Ostrich(); ostrich.Sleep(); ostrich.Eat(); Console.WriteLine("I can fly:" + ostrich.fly()); Console.WriteLine("**************"); Console.WriteLine("**************"); string foodOne = tiger.Hunt(monkey); //string foodTwo=tiger.Hunt(ostrich); //Console.WriteLine($"I can hunt {foodOne} and {foodTwo}"); Console.WriteLine($"I can hunt {foodOne}"); Console.WriteLine("**************"); Console.WriteLine(monkey.Mimic("jump and clap")); }
static void Main(string[] args) { Console.WriteLine("Fox"); Fox fox = new Fox(); Console.WriteLine("from Carnivore"); Console.WriteLine(fox.Eat()); Console.WriteLine("from Animal"); Console.WriteLine(fox.Health()); Console.WriteLine("from DemiGod"); Console.WriteLine(fox.SuperPower()); Console.WriteLine("from IHunt"); Console.WriteLine(fox.Weapon()); Console.WriteLine(); Console.WriteLine("Panda"); Panda panda = new Panda(); Console.WriteLine("from Herbivore"); Console.WriteLine(panda.Eat()); Console.WriteLine("from Animal"); Console.WriteLine(panda.Health()); Console.WriteLine("from DemiGod"); Console.WriteLine(panda.SuperPower()); Console.WriteLine(); Console.WriteLine("Tiger"); Tiger tiger = new Tiger(); Console.WriteLine("from ISleep"); Console.WriteLine(tiger.Nap()); Console.WriteLine("from Carnivore"); Console.WriteLine(tiger.Eat()); Console.WriteLine("from Animal"); Console.WriteLine(tiger.Health()); Console.WriteLine("from DemiGod"); Console.WriteLine(tiger.SuperPower()); Console.WriteLine(); Console.WriteLine("Fox"); Youkai youkai = new Youkai(); Console.WriteLine("from Panda"); Console.WriteLine(youkai.Name()); Console.WriteLine("from Herbivore"); Console.WriteLine(youkai.Eat()); Console.WriteLine("from Animal"); Console.WriteLine(youkai.Health()); Console.WriteLine("from DemiGod"); Console.WriteLine(youkai.SuperPower()); Console.WriteLine("from IHunt"); Console.WriteLine(youkai.Weapon()); Console.WriteLine("from ISleep"); Console.WriteLine(youkai.Asleep); Console.WriteLine(); Console.WriteLine("Animal"); Animal animal = new Animal(); Console.WriteLine("from DemiGod"); Console.WriteLine(fox.SuperPower()); Console.WriteLine(); }