Skip to content
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

Merged
merged 3 commits into from
Sep 29, 2017
Merged

Improve handling of Assert.Inconclusive #277

merged 3 commits into from
Sep 29, 2017

Conversation

jessehouwing
Copy link
Contributor

@jessehouwing jessehouwing commented Sep 28, 2017

To help solve issues found in #249


This change is Reviewable

@msftclas
Copy link

msftclas commented Sep 28, 2017

CLA assistant check
All CLA requirements met.

@@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

@jessehouwing jessehouwing Sep 28, 2017

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.

Copy link
Contributor

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.

@AbhitejJohn
Copy link
Contributor

Thanks for helping out.

public void TestMethodInfoInvokeShouldHandleThrowAssertInconclusive()
{
DummyTestClass.TestMethodBody = (d) => { throw new UTF.AssertInconclusiveException(); };
var asyncMethodInfo = typeof(DummyTestClass).GetMethod("DummyAsyncTestMethod");
Copy link
Member

@jayaranigarg jayaranigarg Sep 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We would want to do GetMethod on "DummyTestMethod" here..
  2. Should we just name the variable as "methodInfo" rather than "asyncMethodInfo" ?

Copy link
Contributor Author

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.

@pvlakshm
Copy link
Contributor

Jesse, great to see this; thank you for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants