-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Describe the bug
While reviewing #447 , I found tests are actually NOT testing codes. Current tests look like this:
var ex = Assert.Throw<...>(... {{method to be tested}});
But it's not actually testing the method. It forcibly throws an exception. Therefore, all the tests should be changed in the following way:
// methods with no async/await
Action action = () => MethodToTest();
action.ShouldThrow<SomethingException>()
.Message.ShouldContain("something message");
// methods with async/await
Func<Task> func = async () => await MethodToTest();
func.ShouldThrow<SomethingException>()
.Message.ShouldContain("something message");