Example #1
0
        public void CalculateTest(double arOne, double arTwo, double expected)
        {
            var calculator   = new Logarithm();
            var actualResult = calculator.Calculate(arOne, arTwo);

            Assert.AreEqual(expected, actualResult, 0.001);
        }
Example #2
0
        public void CalculateTest(double firstValue, double expected)
        {
            var calculator   = new Logarithm();
            var actualResult = calculator.Calculate(firstValue);

            Assert.AreEqual(expected, actualResult, 0.0001);
        }
Example #3
0
        public void CalculateTest()
        {
            IOneArgumentCalculator calculator = new Logarithm();
            double result = calculator.Calculate(1);

            Assert.AreEqual(0, result, 0.01);
        }
Example #4
0
        public void NegativeCalculateTest()
        {
            var calculator = new Logarithm();

            Assert.Throws <System.Exception>(() => calculator.Calculate(-4, 1));
        }
Example #5
0
        public void ExceptionLessThanZeroTest(double firstArgument)
        {
            var calculator = new Logarithm();

            Assert.Throws <Exception>(() => calculator.Calculate(firstArgument));
        }
Example #6
0
        public void ErrorTest()
        {
            var calculator = new Logarithm();

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