public static async Task Test1Async()
        {
            CloudStorageAccount account = CloudStorageAccount.Parse("");

            AzureStorageFactory storageFactory = new AzureStorageFactory(account, "registration");

            string contentBaseAddress = "http://tempuri.org/content";

            CommitCollector collector = new RegistrationCatalogCollector(new Uri(source), 
                storageFactory)
            {
                ContentBaseAddress = new Uri(contentBaseAddress)
            };
            await collector.Run(CancellationToken.None);

            Console.WriteLine("http requests: {0}", collector.RequestCount);
        }
        protected override void RunCore()
        {
            RegistrationCatalogCollector collector = new RegistrationCatalogCollector(Config.PackageRegistrations.StorageFactory, 200);

            var indexUri = new Uri(Config.Catalog.BaseAddress + "index.json");
            var task = collector.Run(indexUri, _cursor, Config.Catalog.FileSystemEmulator);
            task.Wait();


            //ResolverCollector collector = new ResolverCollector(Config.PackageRegistrations.Storage, 1000);
            //collector.GalleryBaseAddress = Config.Gallery.BaseAddress.AbsoluteUri.TrimEnd('/');
            //collector.ContentBaseAddress = Config.Packages.BaseAddress.AbsoluteUri.TrimEnd('/');

            //var indexUri = new Uri(Config.Catalog.BaseAddress + "index.json");
            //var task = collector.Run(indexUri, _cursor, Config.Catalog.FileSystemEmulator);
            //task.Wait();
        }
        public static async Task Test4Async()
        {
            StorageFactory storageFactory = new FileStorageFactory(new Uri("http://*****:*****@"c:\data\site\reg2");

            //StorageCredentials credentials = new StorageCredentials("", "");
            //CloudStorageAccount account = new CloudStorageAccount(credentials, true);
            //StorageFactory storageFactory = new AzureStorageFactory(account, "reg38", "registration");

            storageFactory.Verbose = true;

            Uri index = new Uri("https://*****:*****@"c:\data\site",
                    InnerHandler = new HttpClientHandler()
                };
            };

            RegistrationCatalogCollector collector = new RegistrationCatalogCollector(index, storageFactory, handlerFunc);

            collector.ContentBaseAddress = new Uri("http://az320820.vo.msecnd.net");

            //collector.PackageCountThreshold = 50;
            //CollectorCursor cursor = new CollectorCursor(new DateTime(2014, 10, 01, 03, 27, 35, 360, DateTimeKind.Utc));

            await collector.Run(CancellationToken.None);

            Console.WriteLine("http requests: {0} batch count: {1}", collector.RequestCount);
        }