protected virtual void CreateUseCases(UseCaseCollection useCaseCollection)
        {
            UseCaseCollectionItem helpUseCaseItem = CreateHelpCommand();

            if (helpUseCaseItem != null)
            {
                useCases.Add(helpUseCaseItem);
            }

            Assembly currentAssembly = Assembly.GetExecutingAssembly();

            IEnumerable <Assembly> assemblies = AppDomain.CurrentDomain.GetAssemblies()
                                                .Where(x => x != currentAssembly);

            foreach (Assembly assembly in assemblies)
            {
                IEnumerable <Type> useCasesTypes = assembly.GetTypes()
                                                   .Where(x => typeof(IUseCase).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract);

                foreach (Type useCasesType in useCasesTypes)
                {
                    string name = useCasesType.Name.EndsWith("UseCase", StringComparison.InvariantCultureIgnoreCase)
                        ? useCasesType.Name.Substring(0, useCasesType.Name.Length - "UseCase".Length).ToLower()
                        : useCasesType.Name;

                    IUseCase useCase = serviceProvider.GetService(useCasesType) as IUseCase;

                    useCaseCollection.Add(name, useCase);
                }
            }
        }
        protected ConsoleApplicationBase()
        {
            serviceProvider = CreateServiceProvider();

            applicationHeader = CreateApplicationHeader();
            ConfigureApplicationHeader(applicationHeader);

            applicationFooter = CreateApplicationFooter();
            ConfigureApplicationFooter(applicationFooter);

            useCases = CreateUseCaseCollection() ?? new UseCaseCollection();
            CreateUseCases(useCases);
        }