Replies: 1 comment
-
That makes sense. I don't think we have a "warning" infrastructure in any of these yet though. but probably doable. If anyone wants to play with this, I would recommend trying it first in the VS extension. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If a Scenario Outline contains the same line twice in its Examples, this is highly likely to be a mistake. (It certainly was when we did it...)
Up until fairly recently, if the duplicate was the last item in the list, this caused a crash when using the MSTest runner, but the error did not make it at all obvious what had gone wrong.
After a fair amount of investigation, we worked out that the feature cleanup would run when it hit an Example that was the same as the final Example, and then when it went on to run the next test, a
NullReferenceException
would occur inside theTestInitializeAsync
method generated in the.feature.cs
file because the teardown had already settestRunner
tonull
.We didn't initially realise that the root cause was the duplication of an Example. It took a long time debugging the innards of Reqnroll and MSTest before we understood what was happening.
We'd have understood the problem much earlier if Reqnroll had simply told us that our Examples contained duplicate entries.
Upgrading to
Microsoft.NET.Test.Sdk
17.11.1 and MSTest 3.6.0 stops the crashes. But it also masks the problem—with the latest versions of these, there's no visible consequence of having duplicate entries. But since it seems likely to be a mistake to have duplicates, it would still be good if Reqnroll could detect this and raise a warning.Beta Was this translation helpful? Give feedback.
All reactions