예제 #1
0
파일: PrimeTests.cs 프로젝트: Res42/CtcTest
        public void Test1(int value, bool expectedIsPrime)
        {
            var isPrime = Calc.isPrime(value);

            Assert.AreEqual(expectedIsPrime, isPrime);
        }
        public void DoMinus(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 1, $"{value} should be 1");
        }
        public void ShouldErrorOnCrap()
        {
            var result = Calc.Calculate(null);

            Assert.IsFalse(result.err.Length == 0, "should not be empty");
        }
        public void DoBODMAS(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 10, $"{value} should be 10");
        }
        public void DoErrors(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsFalse(result.err.Length == 0, $"{value} should yield an error");
        }
예제 #6
0
        public void DoAddMultipy(string value)
        {
            var res = Calc.Calculate(value);

            Assert.IsTrue(res.result == 10, $"{value} should be 10");
        }
예제 #7
0
        public void PrecedenceOrder(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == -92, $"{value} should be -92");
        }
예제 #8
0
        public void DoPlus(string value)
        {
            var result = Calc.Calculate(value);

            Assert.IsTrue(result.result == 6, $"{value} should be 92");
        }