예제 #1
0
        public async Task TestDivision(int num1, int num2, double expectedResult)
        {
            BL.Test2 question2BL = new BL.Test2();

            // Act
            double result = await question2BL.Division(num1, num2);

            // Assert
            Assert.AreEqual(result, expectedResult);
        }
예제 #2
0
        public void TestDivisionException()
        {
            BL.Test2 question2BL = new BL.Test2();

            // Act
            var result = Assert.ThrowsAsync <DivideByZeroException>(async() => await question2BL.Division(10, 0)).Message;

            // Assert
            Assert.AreEqual("Attempted to divide by zero.", result);
        }