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

async test methods #8

Closed
aandrieiev1998 opened this issue Sep 29, 2023 · 3 comments
Closed

async test methods #8

aandrieiev1998 opened this issue Sep 29, 2023 · 3 comments

Comments

@aandrieiev1998
Copy link

For async test methods ordering doesn't work? It is required to disable parallelization for that. Is there a way to achieve that?

@asherber
Copy link
Owner

Can you provide a simple class where ordering doesn't work for you?

@aandrieiev1998
Copy link
Author

aandrieiev1998 commented Sep 29, 2023

Raw example:

using Xunit;
using Xunit.Priority;

public class Testorder
{
    [Fact, Priority(1)]
    public async Task Test1()
    {
        Assert.True(true);
    }
    
    [Fact, Priority(2)]
    public async Task Test2()
    {
        Assert.True(true);
    }
    
    [Fact, Priority(3)]
    public async Task Test3()
    {
        Assert.True(true);
    }
    
    [Fact, Priority(4)]
    public async Task Test4()
    {
        Assert.True(true);
    }
}

@asherber
Copy link
Owner

You need to apply the orderer to the class:

using Xunit;
using Xunit.Priority;

[TestCaseOrderer(PriorityOrderer.Name, PriorityOrderer.Assembly)]
public class Testorder
{

}

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