public void AssertAmountOfGeneratedPrimes(int nPrimes)
        {
            //act
            var primes = primeGenerator.GenerateNPrimes(nPrimes);

            //assert
            Assert.AreEqual(primes.Length, nPrimes);
        }
Esempio n. 2
0
        public IEnumerable <string> GeneratePrimeNumbers(string firstNPrimes)
        {
            var nPrimes = baseConverter.ToBase10(firstNPrimes);

            if (nPrimes < 0)
            {
                throw new InvalidBaseNValueException();
            }

            var base10Primes = primeNumbers.GenerateNPrimes(nPrimes);

            return(base10Primes.Select(p => baseConverter.ToBaseN(p)));
        }