You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NuGetGallery/tests/CatalogTests/ReindexTests.cs

41 lines
1.2 KiB
C#

using NuGet.Services.Metadata.Catalog;
using NuGet.Services.Metadata.Catalog.Persistence;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace CatalogTests
{
public class ReindexTests
{
public static async Task Test0Async()
{
Func<HttpMessageHandler> handlerFunc = () =>
{
return new FileSystemEmulatorHandler
{
BaseAddress = new Uri("http://localhost:8000"),
RootFolder = @"c:\data\site",
InnerHandler = new HttpClientHandler()
};
};
StorageFactory storageFactory = new FileStorageFactory(new Uri("http://localhost:8000/nuspec/"), @"c:\data\site\nuspec");
CommitCollector collector = new ReindexCatalogCollector(new Uri("http://localhost:8000/full/index.json"), storageFactory, handlerFunc);
await collector.Run();
Console.WriteLine("http requests: {0}", collector.RequestCount);
}
public static void Test0()
{
Test0Async().Wait();
}
}
}