We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
testArguments
1 parent 2ebe5d9 commit c62c41fCopy full SHA for c62c41f
1 file changed
src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs
@@ -295,9 +295,11 @@ public MemberDataTest(ISymbol referencedMember,
295
string externAlias,
296
string argumentLoopVarIdentifier)
297
{
298
- TestNameExpression = innerTest.TestNameExpression;
299
Method = innerTest.Method;
300
ContainingType = innerTest.ContainingType;
+ // Use a static expression that doesn't reference the loop variable since it may be used
301
+ // outside the foreach loop scope (e.g., in a ConditionalTest's else branch).
302
+ TestNameExpression = $"\"{externAlias}::{ContainingType}.{Method}(...)\"";
303
DisplayNameForFiltering = $"{ContainingType}.{Method}(...)";
304
305
_innerTest = innerTest;
0 commit comments