Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR comments
  • Loading branch information
jayaranigarg committed Jan 10, 2019
commit 1858a3cc6bdbcd6c99d06e2d6b3d7e6ec14d33a3
27 changes: 27 additions & 0 deletions TestFx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompatTestProject", "test\E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProjectForAssemblyResolution", "test\ComponentTests\TestAssets\TestProjectForAssemblyResolution\TestProjectForAssemblyResolution.csproj", "{0B057B99-DCDD-417A-BC19-3E63DDD86F24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataRowTestProject", "test\E2ETests\TestAssets\DataRowTestProject\DataRowTestProject.csproj", "{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\TestFramework\Extension.Shared\Extension.Shared.projitems*{272ca5e1-8e81-4825-9e47-86cce02f700d}*SharedItemsImports = 13
Expand Down Expand Up @@ -1039,6 +1041,30 @@ Global
{0B057B99-DCDD-417A-BC19-3E63DDD86F24}.Release|x64.Build.0 = Release|Any CPU
{0B057B99-DCDD-417A-BC19-3E63DDD86F24}.Release|x86.ActiveCfg = Release|Any CPU
{0B057B99-DCDD-417A-BC19-3E63DDD86F24}.Release|x86.Build.0 = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|Any CPU.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|ARM.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|ARM.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|x64.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|x64.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|x86.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Code Analysis Debug|x86.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|ARM.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|ARM.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|x64.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|x64.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|x86.ActiveCfg = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Debug|x86.Build.0 = Debug|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|Any CPU.Build.0 = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|ARM.ActiveCfg = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|ARM.Build.0 = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|x64.ActiveCfg = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|x64.Build.0 = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|x86.ActiveCfg = Release|Any CPU
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1098,6 +1124,7 @@ Global
{3FCE3987-7C8C-4E12-B54A-C6EC2D9FC7A6} = {D53BD452-F69F-4FB3-8B98-386EDA28A4C8}
{2D2C5B73-F1F1-47C8-BC5C-A172E9BB3D16} = {D53BD452-F69F-4FB3-8B98-386EDA28A4C8}
{0B057B99-DCDD-417A-BC19-3E63DDD86F24} = {1899187D-8B9C-40C2-9F04-9E9A76C9A919}
{7FB80AAB-7123-4416-B6CD-8D3D69AA83F1} = {D53BD452-F69F-4FB3-8B98-386EDA28A4C8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {31E0F4D5-975A-41CC-933E-545B2201FAF9}
Expand Down
25 changes: 19 additions & 6 deletions test/E2ETests/Smoke.E2E.Tests/DataRowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@ public class DataRowTests : CLITestBase
[TestMethod]
public void ExecuteOnlyDerivedClassDataRowsWhenBothBaseAndDerviedClassHasDataRows()
{
this.InvokeVsTestForExecution(new string[] { TestAssembly });
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.

"DataRowTestMethod (cherry)",
"DataRowTestMethod (banana)",
"DataRowTestMethod (Apple)",
"DataRowTestMethod (orange)",
"DataRowTestMethod (pineapple)");
"DataRowTestMethod (BaseString1)",
"DataRowTestMethod (BaseString2)",
"DataRowTestMethod (BaseString3)",
"DataRowTestMethod (DerivedString1)",
"DataRowTestMethod (DerivedString2)");

// 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.

}

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

this.ValidatePassedTestsContain(
"DataRowTestMethod (DerivedString1)",
"DataRowTestMethod (DerivedString2)");

// 3 tests of DerivedClass - 2 datarow result and 1 parent result
this.ValidatePassedTestsCount(3);
}
}
}
6 changes: 3 additions & 3 deletions test/E2ETests/TestAssets/DataRowTestProject/BaseClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace DataRowTestProject
public class BaseClass
{
[TestMethod]
[DataRow("cherry")]
[DataRow("banana")]
[DataRow("Apple")]
[DataRow("BaseString1")]
[DataRow("BaseString2")]
[DataRow("BaseString3")]
public virtual void DataRowTestMethod(string a)
{
Assert.IsTrue(true);
Expand Down
4 changes: 2 additions & 2 deletions test/E2ETests/TestAssets/DataRowTestProject/DerivedClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace DataRowTestProject
public class DerivedClass : BaseClass
{
[TestMethod]
[DataRow("orange")]
[DataRow("pineapple")]
[DataRow("DerivedString1")]
[DataRow("DerivedString2")]
public override void DataRowTestMethod(string a)
{
Assert.IsTrue(true);
Expand Down