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); }
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); }