Fix multiple results not returned with custom TestMethod and TestClass (#358)#363
Conversation
| currentResult.Duration = watch.Elapsed; | ||
| foreach (var testResult in testResults) | ||
| { | ||
| testResult.DatarowIndex = rowIndex++; |
There was a problem hiding this comment.
DatarowIndex is used for each row of data in dataSource.
By framework extensibility you have now started running each dataRow multiple times(say 5), but we should not increase dataRowIndex for each of the 5 runs of a DataRow. It should be incremented only once per dataRow and not once per testResult.
This statement should be testResult.DataRowIndex = rowIndex;
Do rowIndex++ separately outside of the loop.
| { | ||
| foreach (var test in passedTests) | ||
| { | ||
| var x = string.Join(", ", this.runEventsHandler.PassedTests.Select(_ => _.DisplayName)); |
| Assert.AreNotEqual(3, customTestClass1ExecutionCount); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Consider adding a data-driven test with [IterativeTestMethod] attribute
|
Kindly sign the CLA agreement as well. |
|
Thank you for your contribution @bignoncedric . This PR looks awesome. |
|
@bignoncedric : Any updates here? |
|
Any updates? I'm currently sorting the |
|
@bignoncedric any updates? |
|
@dotnet-bot Test Windows / Debug Build please |
This PR fixes the bug #358.
In
TestMethodRunner, only the first element ofTestResult[]returned byExecutor.Executewas used.A test is also added to validate the RFC 003- Framework Extensibility for Custom Test Execution.