public void GlobalSetup() { this.filter = new ParallelFilter(10, 100); var random = new Random(); this.data = Enumerable.Range(1, 1000000).OrderBy(_ => random.Next()).ToArray(); }
public void ParallelFilterPerformanceTest() { var sw = new Stopwatch(); var filter = new ParallelFilter(10, 100); var random = new Random(); var data = Enumerable.Range(1, 1000000).OrderBy(_ => random.Next()).ToArray(); sw.Start(); filter.Search(data, d => d % 2 == 0); sw.Stop(); Assert.GreaterOrEqual(TimeSpan.FromSeconds(1), sw.Elapsed); }