Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work #11

Open
programuotojasgf opened this issue May 3, 2024 · 1 comment
Open

Does not work #11

programuotojasgf opened this issue May 3, 2024 · 1 comment

Comments

@programuotojasgf
Copy link

Does not work - either Theory or Fact, does not matter. Using latests xUnit.

Could you add an example, so I could test this on a premade project, to be sure it's my fault somehow?

@iikuzmychov
Copy link

.csproj:

<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />

Tests.cs:

using Meziantou.Xunit;

public class ImmutableClass
{
}

[CollectionDefinition(nameof(SomeCollection))]
[EnableParallelization]
public class SomeCollection : ICollectionFixture<ImmutableClass>
{
}

[Collection(nameof(SomeCollection))]
[EnableParallelization]
public class TestClass1
{
    [Fact]
    public async Task Test1() => await Task.Delay(3000);

    [Fact]
    public async Task Test2() => await Task.Delay(3000);
}

[Collection(nameof(SomeCollection))]
[EnableParallelization]
public class TestClass2
{
    [Fact]
    public async Task Test3() => await Task.Delay(3000);

    [Fact]
    public async Task Test4() => await Task.Delay(3000);
}

This sample finishes in 3 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants