// Method which prints out several properties and methods of the Black Widow Class
        public static void DisplayBlackWidow()
        {
            Console.WriteLine(
                "Here is a Black Widow, it is derived from the " +
                "Animal -> Bug -> Spider Classes in order.\n");

            Console.WriteLine(
                "The Black Widow inherets all of the properties and methods accociated with those Classes.\n" +
                "It also Inherets the IBeEvil and ICanFly Interfaces from the Spider Class.\n");

            BlackWidow blackWidow = new BlackWidow();

            Console.WriteLine($"How a Black Widow eats: {blackWidow.Eat(blackWidow.Diet)}\n");

            Console.WriteLine($"What does a Black Widow wear: {blackWidow.BodyCovering}\n");

            Console.WriteLine($"What sound does a Black Widow make: {blackWidow.MakeSound(blackWidow.Sound)}\n");

            Console.WriteLine(
                $"Can Black Widows see you: {blackWidow.LookAround()} All {blackWidow.NumberOfEyes} of them!\n");

            Console.WriteLine(
                $"Is it true that a Black Widow is a creepy, crawly bug: {blackWidow.IsCreepyCrawly}\n");

            Console.WriteLine($"How does a Black Widow fly: {blackWidow.HowIFly()}\n");

            Console.WriteLine($"Which phobias does a Black Widow cause: {blackWidow.PhobiaCaused}\n");
        }
示例#2
0
        public void CanPlayIntroSound()
        {
            //arrange
            BlackWidow Charlotte = new BlackWidow();

            //act

            //assert
            Assert.Equal("I wound you with a kiss.", Charlotte.IntroSound());
        }
        static void Main(string[] args)
        {
            BlackWidow charlotte = new BlackWidow();

            charlotte.name = "charlotte";

            Eagle ernest = new Eagle();

            ernest.name = "ernest";

            GrizzlyBear willis = new GrizzlyBear();

            willis.name = "willis";

            HumpbackWhale karl = new HumpbackWhale();

            karl.name = "karl";

            Mallard cheryl = new Mallard();

            cheryl.name = "cheryl";

            SiberianTiger goliath = new SiberianTiger();

            goliath.name = "goliath";


            Console.WriteLine($"Helo my name is {goliath.name}");
            Console.WriteLine(goliath.Reproduction(goliath.reproduction));
            Console.WriteLine(goliath.Diet(goliath.diet));
            Console.WriteLine("\n");
            Console.WriteLine($"Helo my name is {cheryl.name}");
            Console.WriteLine(cheryl.Reproduction(cheryl.reproduction));
            Console.WriteLine(cheryl.Diet(cheryl.diet));
            Console.WriteLine("\n");
            Console.WriteLine($"Helo my name is {karl.name}");
            Console.WriteLine(karl.Reproduction(karl.reproduction));
            Console.WriteLine(karl.Diet(karl.diet));
            Console.WriteLine("\n");
            Console.WriteLine($"Helo my name is {willis.name}");
            Console.WriteLine(willis.Reproduction(willis.reproduction));
            Console.WriteLine(willis.Diet(willis.diet));
            Console.WriteLine("\n");
            Console.WriteLine($"Helo my name is {ernest.name}");
            Console.WriteLine(ernest.Reproduction(ernest.reproduction));
            Console.WriteLine(ernest.Diet(ernest.diet));
            Console.WriteLine("\n");
            Console.WriteLine($"Helo my name is {charlotte.name}");
            Console.WriteLine(charlotte.Legs(charlotte.legCount));
            Console.WriteLine(charlotte.Exterior(charlotte.exterior, charlotte.segmentedBody));
            Console.WriteLine("\n");
            Console.WriteLine("Thank you come again!");
            Console.Read();
        }
示例#4
0
        static void Main(string[] args)
        {
            AvengerBuilder builder;
            Avengers       avengers = new Avengers();

            builder = new CaptainAmerica();
            avengers.Assemble(builder);

            Console.Write(builder.Avenger.ToString());

            builder = new BlackWidow();
            avengers.Assemble(builder);

            Console.Write(builder.Avenger.ToString());

            avengers.Assemble(new [] { (AvengerBuilder) new CaptainAmerica(), (AvengerBuilder) new BlackWidow() });

            Console.ReadKey();
        }
        public void BlackWidowIsAssignableFromAnimal_ProvingBlackWidowIsAnAnimal()
        {
            BlackWidow blackWidow = new BlackWidow();

            Assert.IsAssignableFrom <Animal>(blackWidow);
        }