示例#1
0
        public void ConvertFromBase10ToBase13AndBack(int base10Number)
        {
            //act
            var base13 = baseConverter.ToBaseN(base10Number);
            var base10 = baseConverter.ToBase10(base13);

            //assert
            Assert.AreEqual(base10Number, base10);
        }
示例#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)));
        }