Skip to content

Base class data rows should not be executed - #546

Merged
Jayarani garg (jayaranigarg) merged 6 commits into
microsoft:masterfrom
jayaranigarg:issue458
Jan 11, 2019
Merged

Base class data rows should not be executed#546
Jayarani garg (jayaranigarg) merged 6 commits into
microsoft:masterfrom
jayaranigarg:issue458

Conversation

@jayaranigarg

@jayaranigargJayarani garg (jayaranigarg) commented Dec 19, 2018

Copy link
Copy Markdown
Member

#458

Need to add tests.

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
Copy Markdown
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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Added.

// 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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Jayarani garg (jayaranigarg) merged commit ea644c1 into microsoft:masterJan 11, 2019
Sign up for freeto 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

@jayaranigarg@singhsarab