Exemple #1
0
        public void Divisions_divide4by0_returnsInfinity()
        {
            var uut = new CalculatorClass.Calculator();

            var ex =
                Assert.Catch <DivideByZeroException>(() => uut.Divide(5, 0));
        }
Exemple #2
0
        public void Divisions_divide5by0_throwsDivZeroError()
        {
            var uut = new CalculatorClass.Calculator();

            var ex =
                Assert.Catch <DivideByZeroException>(() => uut.Divide(5, 0));
        }
Exemple #3
0
        public double DivisionWithTestCase_MultiplyWithInitializedAccumulator_ReturnsResult(double divisor)
        {
            var uut = new CalculatorClass.Calculator();

            uut.Add(4); // Accumulator = 4 - Given that Add works as proposed.

            return(uut.Divide(divisor));
        }
Exemple #4
0
        public void Divisions_divide9by3_returns3()
        {
            var uut = new CalculatorClass.Calculator();

            Assert.That(uut.Divide(9, 3), Is.EqualTo(3));
        }
Exemple #5
0
        public double DivisionWithTestCase_MultiplyWithUninitializedAccumulator_ReturnsResult(double divisor)
        {
            var uut = new CalculatorClass.Calculator();

            return(uut.Divide(divisor));
        }
Exemple #6
0
        public void Divisions_divide5by2_returnsMinus2point5()
        {
            var uut = new CalculatorClass.Calculator();

            Assert.That(uut.Divide(5, 2), Is.EqualTo(2.5));
        }