Example #1
0
        public void PrimeCheckRec_DivideByZeroException_Test()
        {
            int num     = 1;
            int divisor = 0;

            Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(num, divisor));
            var ex = Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(num, divisor));

            Assert.Equal("Attempted to divide by zero.", ex.Message);
        }
Example #2
0
        public void PrimeCheckRec()
        {
            int num     = 1;
            int divisor = 0;

            // r.PrimeCheckRec (num, divisor);
            Assert.Throws <Exception> (() => r.PrimeCheckRec(num, divisor));
            var ex = Assert.Throws <Exception> (() => r.PrimeCheckRec(num, divisor));

            Assert.Equal("Error, can't divide by zero.", ex.Message);
        }
Example #3
0
        public void PrimeCheckRec_Test()
        {
            int  num                 = 1;
            int  divisor             = 1;
            bool primecheckrecresult = true;

            Assert.Equal(primecheckrecresult, r.PrimeCheckRec(num, divisor));
        }
Example #4
0
        public void PrimeCheckRecTest(int primenum, int divisor)
        {
            RecursiveCalc r = new RecursiveCalc();

            Assert.Throws <DivideByZeroException> (() => r.PrimeCheckRec(primenum, divisor));
        }