예제 #1
0
 private IEnumerable <String> CallToCount(string[] userCommandArgs, int argsCount)
 {
     if (argsCount > 0)
     {
         var gender = Gender.Parse(userCommandArgs[1]);
         if (gender.HasValue)
         {
             if (argsCount == 2)
             {
                 var type = userCommandArgs[2];
                 Console.WriteLine(animalCollection.Count(type, gender.ToString()));
             }
             else
             {
                 Console.WriteLine(animalCollection.Count(gender.Value.ToString()));
             }
         }
         else
         {
             Console.WriteLine(animalCollection.CountByType(userCommandArgs[1]));
         }
     }
     else
     {
         Console.WriteLine(animalCollection.Count());
     }
     return(new List <string>());
 }