Skip to content

Commit 8f4370c

Browse files
rogeralsingclaude
andcommitted
Fix test count for parameterized tests
Update total dynamically as TestStarted events arrive, since NUnit expands parameterized tests (e.g., strict/non-strict mode) which results in more actual tests than our discovery finds. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 35ffd5d commit 8f4370c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Asynkron.TestRunner/LiveDisplay.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class LiveDisplay
2121
private int _skipped;
2222
private int _hanging;
2323
private int _crashed;
24+
private int _seen; // Actual unique tests seen (handles parameterized expansion)
2425
private readonly HashSet<string> _running = new();
2526
private string? _lastCompleted;
2627
private string? _lastStatus;
@@ -32,7 +33,14 @@ public void SetTotal(int total)
3233

3334
public void TestStarted(string displayName)
3435
{
35-
lock (_lock) _running.Add(Truncate(displayName, ContentWidth));
36+
lock (_lock)
37+
{
38+
_running.Add(Truncate(displayName, ContentWidth));
39+
_seen++;
40+
// Update total if we're seeing more tests than discovered (parameterized expansion)
41+
if (_seen > _total)
42+
_total = _seen;
43+
}
3644
}
3745

3846
public void TestPassed(string displayName)

0 commit comments

Comments
 (0)