static async Task Test0Async()
        {
            StorageFactory factory = new FileStorageFactory(new Uri("https://tempuri.org/test"), @"c:\\data\\test");

            Console.WriteLine(factory);

            Storage storage = factory.Create();

            StorageContent content = new StringStorageContent("TEST");
            await storage.Save(new Uri(storage.BaseAddress, "doc1.txt"), content, CancellationToken.None);
        }
        public static async Task Test0Async()
        {
            Func<HttpMessageHandler> handlerFunc = () =>
            {
                return new FileSystemEmulatorHandler
                {
                    BaseAddress = new Uri("http://*****:*****@"c:\data\site",
                    InnerHandler = new HttpClientHandler()
                };
            };

            StorageFactory storageFactory = new FileStorageFactory(new Uri("http://*****:*****@"c:\data\site\nuspec");

            CommitCollector collector = new ReindexCatalogCollector(new Uri("http://localhost:8000/full/index.json"), storageFactory, handlerFunc);

            await collector.Run(CancellationToken.None);

            Console.WriteLine("http requests: {0}", collector.RequestCount);
        }
        public static async Task Test0Async()
        {
            string path = "c:\\data\\test";

            DirectoryInfo directoryInfo = new DirectoryInfo(path);
            if (directoryInfo.Exists)
            {
                directoryInfo.Delete(true);
            }
            directoryInfo.Create();

            IDictionary<string, IGraph> catalog = new Dictionary<string, IGraph>();
            //catalog.Add(CreateTestCatalogEntry("mypackage", "1.0.0"));
            //catalog.Add(CreateTestCatalogEntry("mypackage", "2.0.0"));
            catalog.Add(CreateTestCatalogEntry("mypackage", "3.0.0"));
            catalog.Add(CreateTestCatalogEntry("mypackage", "4.0.0"));
            catalog.Add(CreateTestCatalogEntry("mypackage", "5.0.0"));
            FileStorageFactory factory = new FileStorageFactory(new Uri("http://tempuri.org"), path);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), catalog, factory, new Uri("http://content/"), 2, 3, false, CancellationToken.None);
        }
        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);
        }
        public static async Task Test2Async()
        {
            string path = "c:\\data\\test";

            DirectoryInfo directoryInfo = new DirectoryInfo(path);
            if (directoryInfo.Exists)
            {
                directoryInfo.Delete(true);
            }
            directoryInfo.Create();

            FileStorageFactory factory = new FileStorageFactory(new Uri("http://tempuri.org"), path);

            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "1.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "2.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "3.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "4.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "5.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
            await RegistrationMaker.Process(new RegistrationKey("mypackage"), CreateTestSingleEntryBatch("mypackage", "6.0.0"), factory, new Uri("http://content/"), 10, 10, false, CancellationToken.None);
        }
        public static async Task Test4Async()
        {
            //Uri catalogUri = new Uri("https://nugetdevstorage.blob.core.windows.net/catalog/index.json");
            Uri catalogUri = new Uri("https://nugetjohtaylo.blob.core.windows.net/catalog/index.json");
            //Uri catalogUri = new Uri("https://api.nuget.org/v3/catalog0/index.json");

            string path = "c:\\data\\registration20150421";

            DirectoryInfo directoryInfo = new DirectoryInfo(path);
            if (directoryInfo.Exists)
            {
                directoryInfo.Delete(true);
            }
            directoryInfo.Create();

            FileStorageFactory factory = new FileStorageFactory(new Uri("http://tempuri.org"), path);

            CollectorBase collector = new RegistrationCollector(catalogUri, factory)
            {
                UnlistShouldDelete = true,
                Concurrent = false
            };

            await collector.Run(CancellationToken.None);
        }