public async Task Search(string term, string[] matches) { CancellationTokenSource cts = new CancellationTokenSource(); var result = await basicSearchIndex.Search(term, cts.Token); Assert.All(matches, (document) => result.Any(a => a.KeyPath == document)); }
public async Task SearchPerformance(string term) { CancellationTokenSource cts = new CancellationTokenSource(); Stopwatch sw = new Stopwatch(); sw.Start(); var results = await _BigSearchIndex.Search(term, cts.Token); sw.Stop(); _Output.WriteLine($"Time: {sw.Elapsed}"); _Output.WriteLine($"Results: {results.Count}"); Assert.True(sw.ElapsedMilliseconds < 500); }