public void GeneratePrimeNumbersMinimalBoundTest()
        {
            Random random       = new Random();
            var    actualResult = PrimeNumbersHelper.GeneratePrimeNumbers(random.Next(-1, 1));

            Assert.AreEqual(0, actualResult.Count());
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            int bound;

            Console.WriteLine("Bound: ");
            if (int.TryParse(Console.ReadLine(), out bound))
            {
                List <int> primeNumbers = PrimeNumbersHelper.GeneratePrimeNumbers(bound).ToList();
                double     result       = PrimeNumbersHelper.AggregatePrimesDividedByOrderNumber(bound);
                Console.WriteLine("-----------Prime Numbers----------");
                primeNumbers.ForEach(Console.WriteLine);

                Console.WriteLine("-------------Result---------------");
                Console.WriteLine(result);
            }

            Console.ReadKey();
        }
        public void GeneratePrimeTest()
        {
            var actualResult = PrimeNumbersHelper.GeneratePrimeNumbers(100).ToList();

            CollectionAssert.AreEqual(_testPrimeNumbers, actualResult);
        }
        public void GeneratePrimeNumbersMaxiumBoundTest()
        {
            var actualResult = PrimeNumbersHelper.GeneratePrimeNumbers(1100000000);

            Assert.AreEqual(0, actualResult.Count());
        }