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

Output Ignore Message for Ignored Tests #165

Merged
merged 4 commits into from
Apr 26, 2017

Conversation

jayaranigarg
Copy link
Member

No description provided.

@msftclas
Copy link

@jayaranigarg,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@jayaranigarg jayaranigarg added this to the S117 milestone Apr 24, 2017
{
var ignoreAttribute = GetCustomAttributes(ignoreAttributeProvider, typeof(IgnoreAttribute), true);

if (ignoreAttribute == null || ignoreAttribute.Length != 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use ignoreAttribute.Any() instead.

return null;
}

return (ignoreAttribute[0] as IgnoreAttribute).IgnoreMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ignoreAttribute?.FirstOrDefault()


if (string.IsNullOrEmpty(ignoreMessage) && isIgnoreAttributeOnMethod)
{
ignoreMessage = this.reflectHelper.GetIgnoreMessage(this.testMethodInfo.TestMethod);
Copy link
Contributor

Choose a reason for hiding this comment

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

Tagging @pvlakshm to review the order - Ignore attribute on method takes precedence over class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Had a discussion with Pratap sir...Ignore on class takes precedence over Ignore on Method.

@@ -111,6 +116,106 @@ public void Cleanup()
}

[TestMethodV1]
public void IgnoreAttributeOnTestClassIgnoresTestAndPrintsClassIgnoreMessageIfProvided()
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't all these method names start with ExecuteShould instead since that is what you are acting on below?

@@ -84,6 +128,26 @@ internal UnitTestResult[] Execute()
string inittestContextMessages = string.Empty;

UnitTestResult[] result = null;

Copy link
Contributor

Choose a reason for hiding this comment

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

a related question: How can someone leverage extensibility to achieve this test level skipping?

@jayaranigarg jayaranigarg merged commit bd95f57 into microsoft:master Apr 26, 2017
@jayaranigarg
Copy link
Member Author

#126

@jayaranigarg jayaranigarg deleted the ignore branch April 26, 2017 08:58
singhsarab pushed a commit to singhsarab/testfx that referenced this pull request Apr 8, 2019
…ed instances. (microsoft#165)

* Add missing resource. Whitespace is not a localizable resource, removed instances.

* Fix VS build.

* Fix unit test failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants