Exemple #1
0
        public void TestDivision_WithException()
        {
            // arrange
            int op1 = 100;
            int op2 = 0;
            ALU alu = new ALU();

            // act
            int actual = alu.Divide(op1, op2);

            // assert is handled by ExpectedException
        }
Exemple #2
0
        public void TestDivision()
        {
            // arrange
            int op1      = 100;
            int op2      = 5;
            int expected = 20;
            ALU alu      = new ALU();

            // act
            int actual = alu.Divide(op1, op2);

            // assert
            Assert.AreEqual(expected, actual, 0.001, "Division failed.");
        }