Skip to content

How to migrate xUnit fixtures? #601

Answered by thomhurst
Xzelsius asked this question in Q&A
Discussion options

You must be logged in to vote

Or this:

public sealed class AzuriteInfrastructure : IAsyncInitializer, IAsyncDisposable
{
    private readonly AzuriteContainer container;

    public AzuriteInfrastructure()
    {
        try
        {
            this.container = new AzuriteBuilder()
                .WithCleanUp(true)
                .Build();
        }
        catch
        {
            throw new TestClassException("Failed to create Azurite test container definition");
        }
    }

    public Task InitializeAsync()
    {
        return this.container.StartAsync();
    }

    public async ValueTask DisposeAsync()
    {
        await this.container.StopAsync();
        await this.container.DisposeAsync();
    }
}

[C…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Xzelsius
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants