/// <summary>
        ///   Loads the module into the kernel.
        /// </summary>
        /// <param name="container">The container.</param>
        public void register_components(Container container)
        {
            var config            = Config.get_configuration_settings();
            var packagesCheckTask = new CheckForPackagesTask(config);

            if (config.PackageTypesToVerify.to_lower() != "submitted")
            {
                var thirtyDaysAgo = DateTime.UtcNow.AddDays(-30);
                packagesCheckTask.ServiceEndpoint = "/api/v2/";

                // we should not have any existing packages that have not been tested
                //pv.PackageTestResultStatus == null
                //todo: We are going to rerun all existing packages, even failing for now - after this run is complete, we will only rerun passing
                // we are doing this because we've completed some major fixes to the verifier that may fix some of the failing packages.
                //&& (pv.PackageTestResultStatus == "Passing" && pv.PackageTestResultStatusDate < thirtyDaysAgo)

                packagesCheckTask.AdditionalPackageSelectionFilters = p => p.Where(
                    pv => pv.IsLatestVersion &&
                    (pv.PackageTestResultStatusDate == null || pv.PackageTestResultStatusDate < thirtyDaysAgo || pv.PackageTestResultStatus == "Pending") &&
                    pv.PackageTestResultStatus != "Exempted"
                    );
            }
            else
            {
                // We should only include packages in the verification queue, if they have first been successfully validated, or if it has been
                // exempted from validation.
                // In the case where the package version is a pre-release package, if it has also failed validation, it should be added to the
                // package verifier queue
                packagesCheckTask.AdditionalPackageSelectionFilters = p => p.Where(
                    pv => (pv.PackageTestResultStatus == null || pv.PackageTestResultStatus == "Pending" || pv.PackageTestResultStatus == "Unknown") &&
                    ((pv.PackageValidationResultStatus == "Passing" || pv.PackageValidationResultStatus == "Exempted") ||
                     (pv.IsPrerelease && pv.PackageValidationResultStatus == "Failing")));
            }

            container.Register <IEnumerable <ITask> >(
                () =>
            {
                var list = new List <ITask>
                {
                    new StartupTask(),
                    packagesCheckTask,
                    new TestPackageTask(container.GetInstance <IPackageTestService>(), container.GetInstance <IFileSystem>(), container.GetInstance <IConfigurationSettings>(), container.GetInstance <IImageUploadService>()),
                    new CreateGistTask(container.GetInstance <IGistService>()),
                    new UpdateWebsiteInformationTask(container.GetInstance <IConfigurationSettings>(), container.GetInstance <INuGetService>())
                };

                return(list.AsReadOnly());
            },
                Lifestyle.Singleton);
        }
        /// <summary>
        ///   Loads the module into the kernel.
        /// </summary>
        /// <param name="container">The container.</param>
        public void register_components(Container container)
        {
            var config = Config.get_configuration_settings();
            var packagesCheckTask = new CheckForPackagesTask(config);
            if (config.PackageTypesToVerify.to_lower() != "submitted")
            {
                var thirtyDaysAgo = DateTime.UtcNow.AddDays(-30);
                packagesCheckTask.ServiceEndpoint = "/api/v2/";

                // we should not have any existing packages that have not been tested
                //pv.PackageTestResultStatus == null
                //todo: We are going to rerun all existing packages, even failing for now - after this run is complete, we will only rerun passing
                // we are doing this because we've completed some major fixes to the verifier that may fix some of the failing packages.
                //&& (pv.PackageTestResultStatus == "Passing" && pv.PackageTestResultStatusDate < thirtyDaysAgo)

                packagesCheckTask.AdditionalPackageSelectionFilters = p => p.Where(
                    pv => pv.IsLatestVersion
                          && (pv.PackageTestResultStatusDate == null || pv.PackageTestResultStatusDate < thirtyDaysAgo)
                          && pv.PackageTestResultStatus != "Exempted"
                    );
            }
            else
            {
                packagesCheckTask.AdditionalPackageSelectionFilters = p => p.Where(
                    pv => (pv.PackageTestResultStatus == null 
                           || pv.PackageTestResultStatus == "Pending" 
                           || pv.PackageTestResultStatus == "Unknown")
                          );
            }

            container.Register<IEnumerable<ITask>>(
                () =>
                {
                    var list = new List<ITask>
                    {
                        new StartupTask(),
                        packagesCheckTask,
                        new TestPackageTask(container.GetInstance<IPackageTestService>(),container.GetInstance<IFileSystem>(),container.GetInstance<IConfigurationSettings>()),
                        new CreateGistTask(container.GetInstance<IGistService>()),
                        new UpdateWebsiteInformationTask(container.GetInstance<IConfigurationSettings>(),container.GetInstance<INuGetService>())
                    };

                    return list.AsReadOnly();
                },
                Lifestyle.Singleton);
        }