Пример #1
0
        public void FindMore_Size10Sieve_Correct()
        {
            PrimeSieve sieve = new PrimeSieve(10);

            sieve.FindMore();

            var foundPrimes = sieve.Primes;

            Assert.That(foundPrimes, Is.EqualTo(new Int64[] { 2, 3, 5, 7, 11, 13, 17, 19 }));
        }
Пример #2
0
        public void FindMore_10001stPrime_OddFieldSize()
        {
            PrimeSieve sieve = new PrimeSieve(7);

            while (sieve.Primes.Count <= 10000)
            {
                sieve.FindMore();
            }

            Assert.That(sieve.Primes.Count, Is.GreaterThan(10000));
            Assert.That(sieve.Primes[10000], Is.EqualTo(104743));
        }