public void Test1(int userInput, int expected)
        {
            PrimeNumbers PNums  = new PrimeNumbers();
            int          result = PNums.GetPrime(userInput);

            Assert.Equal(expected, result);
        }
示例#2
0
        public void Test1(int userInput, int expected)
        {
            PrimeNumbers pnum = new PrimeNumbers();
            int          res  = PrimeNumbers.GetPrime(userInput);

            Assert.Equal(expected, res);
        }
示例#3
0
        public void TestAll(int userNum, int expected)
        {
            PrimeNumbers primeNum = new PrimeNumbers();
            int          final    = primeNum.GetPrime(userNum);

            Assert.Equal(expected, final);
        }
        public void PrimeTest1(int first, int expected)
        {
            PrimeNumbers num    = new PrimeNumbers();
            int          result = num.GetPrime(first);

            Assert.Equal(expected, result);
        }
示例#5
0
        public void TestPrimes(int n, int expected)
        {
            PrimeNumbers numbers = new PrimeNumbers();
            int          result  = numbers.GetPrime(n);

            Assert.Equal(expected, result);
        }
示例#6
0
        public void Test5()
        {
            int       choice = 5;
            ArrayList myList = new ArrayList();

            PrimeNumbers.CreatePrimeList(myList);
            Assert.Equal(11, PrimeNumbers.GetPrime(myList, choice));
        }
示例#7
0
        public void TestRunTime(int n, int seconds)
        {
            PrimeNumbers numbers = new PrimeNumbers();
            DateTime     start   = DateTime.Now;

            numbers.GetPrime(n);
            DateTime stop   = DateTime.Now;
            double   result = (stop - start).Seconds + ((stop - start).Milliseconds / 1000);

            Assert.InRange(result, 0, seconds);
        }
示例#8
0
        public void One(int a, int expected)
        {
            int result = PrimeNumbers.GetPrime(a);

            Assert.Equal(expected, result);
        }
示例#9
0
        public void PrimeNumberTest(int n, int expected)
        {
            int result = PrimeNumbers.GetPrime(n);

            Assert.Equal(expected, result);
        }