예제 #1
0
        public void CalculateTest(double argument, double result, double accracy)
        {
            var testingFunction = new Arccos();
            var testResult      = testingFunction.Calculate(argument);

            Assert.AreEqual(result, testResult, accracy);
        }
예제 #2
0
        public void CalculateTest(double firstValue, double expected)
        {
            var calculator   = new Arccos();
            var actualResult = calculator.Calculate(firstValue);

            Assert.AreEqual(expected, actualResult, 0.1);
        }
예제 #3
0
        public void Calculate()
        {
            Arccos calculator = new Arccos();
            double result     = calculator.Calculate(0);

            Assert.AreEqual(1.571, result, 0.001);
        }
예제 #4
0
        public void CalculateTest()
        {
            IOneArgumentCalculator calculator = new Arccos();
            double result = calculator.Calculate(1);

            Assert.AreEqual(0, result, 0.01);
        }
예제 #5
0
        void CalcTests(double testnum)
        {
            Arccos rad = new Arccos();
            double expResult = Math.Pow(testnum, 1f / 2f), actResult = rad.Calculate(testnum);

            Assert.AreEqual(expResult, actResult);
        }
예제 #6
0
        public void ExceptionTest(double firstArgument)
        {
            var calculator = new Arccos();

            Assert.Throws <Exception>(() => calculator.Calculate(firstArgument));
        }
예제 #7
0
 public void ArcTestsNegative()
 {
     var calculator = new Arccos();
     var result     = calculator.Calculate(-6);
 }
예제 #8
0
        public void CalculateTestExceptionTest()
        {
            IOneArgumentCalculator calculator = new Arccos();

            Assert.Throws <Exception>(() => calculator.Calculate(3));
        }