Esempio n. 1
0
        public static void RunSheep()
        {
            Sheep sheep = new Sheep("Blackie");

            CountUtil.Count(sheep, 2);


            Console.WriteLine("Now, let us clone Blackie!");
            Sheep  clone     = sheep.Clone() as Sheep;
            string cloneName = Validation.GetName("\nVhat vould you like to name the clone? ");

            clone.Name = cloneName;
            clone.ResetCount();
            int userNumber = Validation.GetNumber($"\nHow many times vould you like to count {cloneName}? ");

            CountUtil.Count(clone, userNumber);
            sheep.ResetCount();

            CountUtil.Count(sheep, 1);
        }
Esempio n. 2
0
 public static void RunTest(ICountable c, int MaxCount, string newName)
 {
     ((Sheep)c).Name = newName;
     CountUtil.Count(c, MaxCount);
 }
Esempio n. 3
0
        public static void RunAlligator()
        {
            Alligator alligator = new Alligator("alligator");

            CountUtil.Count(alligator, 3);
        }
Esempio n. 4
0
 public static void RunTest(ICountable c, int MaxCount)
 {
     CountUtil.Count(c, MaxCount);
 }