private void ConfigureForCountGenderCommand(CommandLineApplication cla)
        {
            cla.Command("countgender", (application) =>
            {
                application.Description        = "With this command you can count the people with the given gender";
                CommandArgument genderArgument = application.Argument("gender", "The gender of Person to look for: Male | Female", (argument) =>
                {
                    argument.ShowInHelpText = true;
                });
                application.OnExecute(() =>
                {
                    if (cla.OptionHelp.HasValue())
                    {
                        application.ShowHelp("countgender");
                        return(0);
                    }

                    Gender gender;
                    if (!Enum.TryParse(genderArgument.Value, true, out gender))
                    {
                        application.Error.WriteLine($"The argument {genderArgument.Name} cannot be parsed.");
                        return(-1);
                    }
                    uint count = addressBookBusiness.CountGenders(gender);
                    Console.WriteLine($"There are {count} {gender}s.");
                    return(0);
                });
            });
        }
        public void WhenGivenGender_CanCountPersonsWithSpecifiedGender()
        {
            Gender gender;
            uint   countReal, countCalculated;

            gender = Gender.Female;

            countCalculated = addressBookBusiness.CountGenders(gender);
            countReal       = (uint)(from person in persons
                                     where person.Gender == gender
                                     select person).Count();

            addressBookRepositoryMock.Verify(abr => abr.RetrieveAllPersons(), Times.Once);
            Assert.AreEqual(countReal, countCalculated);
        }