public void Should_match_expected_prime_numbers(int upperbound, long[] expectedPrimeNumbers) { var input = new PrimeNumberInput(upperbound); var output = this.generator.GeneratePrimeNumbers <PrimeNumberOutput>(input); Assert.AreEqual(output.PrimeNumbers, expectedPrimeNumbers); }
public void Should_not_timeout_when_generating_prime_numbers(int upperbound, int maximumTime) { var start = DateTime.Now; var input = new PrimeNumberInput(upperbound); this.generator.GeneratePrimeNumbers <PrimeNumberOutput>(input); var timeTaken = (DateTime.Now - start).Milliseconds; Console.WriteLine($"Time taken: {timeTaken}ms to generate {input.UpperBound} prime numbers"); Assert.LessOrEqual(timeTaken, maximumTime); }