-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of Assert.Inconclusive #277
Conversation
@@ -231,7 +231,7 @@ private TestResult ExecuteInternal(object[] arguments) | |||
|
|||
if (result.Outcome != TestTools.UnitTesting.UnitTestOutcome.Passed) | |||
{ | |||
if (ex.InnerException != null && ex.InnerException is AssertInconclusiveException) | |||
if (ex is UTF.AssertInconclusiveException || ex.InnerException is UTF.AssertInconclusiveException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please add a null check for ex.InnerException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should not be needed, as is
will return false when compared to null. If for clarity or performance reasons, I can add it back in. The expression became harder to read and the effect is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. Don't think there would be much of a perf hit.
Thanks for helping out. |
public void TestMethodInfoInvokeShouldHandleThrowAssertInconclusive() | ||
{ | ||
DummyTestClass.TestMethodBody = (d) => { throw new UTF.AssertInconclusiveException(); }; | ||
var asyncMethodInfo = typeof(DummyTestClass).GetMethod("DummyAsyncTestMethod"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We would want to do GetMethod on "DummyTestMethod" here..
- Should we just name the variable as "methodInfo" rather than "asyncMethodInfo" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and almost. methodInfo was a class member, so I've made it "dummyMethodInfo" instead.
Jesse, great to see this; thank you for contributing! |
To help solve issues found in #249
This change is