public void ThreeArray() { int[] array = PrimeGenerator.GeneratePrimes(3); Assert.AreEqual(array.Length, 2); Assert.AreEqual(array[0], 2); Assert.AreEqual(array[1], 3); }
private void RunInternal(int max) { var primes = new PrimeGenerator(); long maxA = 0, maxB = 0, maxPrimeCount = 0; foreach (long b in primes.GeneratePrimes(max)) { for (long a = 0; a < max; a++) { TestPrimeCount(primes, a, b, ref maxA, ref maxB, ref maxPrimeCount); TestPrimeCount(primes, -a, b, ref maxA, ref maxB, ref maxPrimeCount); TestPrimeCount(primes, a, -b, ref maxA, ref maxB, ref maxPrimeCount); TestPrimeCount(primes, -a, -b, ref maxA, ref maxB, ref maxPrimeCount); } } Console.WriteLine(maxA * maxB); }
public void CentArray() { int[] array = PrimeGenerator.GeneratePrimes(100); Assert.AreEqual(array.Length, 25); Assert.AreEqual(array[24], 97); }
public void MinArray() { int[] array = PrimeGenerator.GeneratePrimes(2); Assert.AreEqual(array.Length, 1); Assert.AreEqual(array[0], 2); }
public void NullArray() { int[] array = PrimeGenerator.GeneratePrimes(0); Assert.AreEqual(array.Length, 0); }