Skip to content

[Feature]: xunit's DisableDiscoveryEnumeration #5833

@kzrnm

Description

@kzrnm

Problem Statement

It would be useful to have an option similar to xUnit’s DisableDiscoveryEnumeration, where test cases are not discovered during discovery but instead executed at runtime.

This could help reduce IDE overhead when there are thousands of test cases.

https://api.xunit.net/v3/2.0.0/v3.2.0.0-Xunit.TheoryAttribute.DisableDiscoveryEnumeration.html

Proposed Solution

public static IEnumerable<int> TestData() => Enumerable.Range(0, 10000);
[Test]
[MethodDataSource(nameof(TestData), DisableDiscoveryEnumeration = true)]
public async Task MyTest(int input)
{
    await Assert.That(input).IsBetween(0, int.MaxValue);
}

Alternatives Considered

No response

Feature Category

Data-Driven Testing (Arguments, DataSources)

How important is this feature to you?

Nice to have - would improve my experience

Additional Context

No response

Contribution

  • I'm willing to submit a pull request for this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions