public void GetResultsFromValidInput(uint number) { var results = sieveAPI.GetSieveListOfResult(number)?.Value; Assert.True(results.All(prime => SieveTestHelper.isPrime(prime) == true)); Assert.True(results.Count() > 0); }
public void ExecuteSieveExpectingResultsForValue(uint value) { Sieve sieve = new SieveOfEratosthenesImplementation(value); uint[] primes = sieve.FindPrimeNumbers(); Assert.NotEqual(null, primes); Assert.True(primes.All(prime => SieveTestHelper.isPrime(prime))); switch (value) { case 2: Assert.True(primes.Count() == 1); break; case 120: Assert.True(primes.Count() == 30); break; case 150978: Assert.True(primes.Count() == 13930); break; default: break; } }