private void ConfigureForFindUserByNameCommand(CommandLineApplication cla)
        {
            cla.Command("findperson", (application) =>
            {
                application.Description  = "With this command you can search for the people's names. The search is not case-sensitive and it starts searching from beginning of the people's fullname.";
                CommandOption nameOption = application.Option("-n |--Name", "The name of Person.", CommandOptionType.SingleValue, (option) =>
                {
                    option.ShowInHelpText = true;
                });
                application.OnExecute(() =>
                {
                    if (cla.OptionHelp.HasValue())
                    {
                        application.ShowHelp("findperson");
                        return(0);
                    }

                    string personName            = nameOption.HasValue() ? nameOption.Value() : string.Empty;
                    IEnumerable <Person> persons = addressBookBusiness.FindPersonByName(personName);
                    foreach (Person person in persons)
                    {
                        person.Print();
                    }
                    return(0);
                });
            });
        }
        public void WhenPersonNameGiven_CanFindThePerson()
        {
            string name = persons[0].FullName.Substring(0, 3).ToLowerInvariant();
            IEnumerable <Person> personsReal, personsCalculated;

            personsReal = from person in persons
                          where person.FullName.StartsWith(name, StringComparison.InvariantCultureIgnoreCase)
                          select person;

            personsCalculated = addressBookBusiness.FindPersonByName(name);

            addressBookRepositoryMock.Verify(abr => abr.RetrieveAllPersons(), Times.Once);
            CollectionAssert.AreEquivalent(personsReal.ToList(), personsCalculated.ToList());
        }