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

Base class data rows should not be executed #546

Merged
merged 6 commits into from
Jan 11, 2019

Conversation

jayaranigarg
Copy link
Member

@jayaranigarg jayaranigarg commented Dec 19, 2018

#458

Need to add tests.

@@ -303,7 +303,7 @@ internal UnitTestResult[] RunTestMethod()
}
else
{
UTF.ITestDataSource[] testDataSources = this.testMethodInfo.GetAttributes<Attribute>(true)?.Where(a => a is UTF.ITestDataSource).OfType<UTF.ITestDataSource>().ToArray();
UTF.ITestDataSource[] testDataSources = this.testMethodInfo.GetAttributes<Attribute>(false)?.Where(a => a is UTF.ITestDataSource).OfType<UTF.ITestDataSource>().ToArray();
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 add tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

@jayaranigarg jayaranigarg requested a review from abhishkk January 10, 2019 06:12
// 4 tests of BaseClass - 3 datarow result and 1 parent result
// 3 tests of DerivedClass - 2 datarow result and 1 parent result
// Total 7 tests - Making sure that DerivedClass doesn't run BaseClass tests
this.ValidatePassedTestsCount(7);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is little confusing.
We should rather run only the DerviedClass tests using filter maybe and then check for only that.
We can keep this one as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't realize the confusion. Added new test.

{
this.InvokeVsTestForExecution(new string[] { TestAssembly }, testCaseFilter: "FullyQualifiedName~DerivedClass");

this.ValidatePassedTestsContain(
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 this validation change after using the filter ?

Copy link
Member Author

Choose a reason for hiding this comment

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

By mistake added filter in first test.

@jayaranigarg jayaranigarg merged commit ea644c1 into microsoft:master Jan 11, 2019
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.

2 participants