MyGit

3.0.0

testcontainers/testcontainers-dotnet

版本发布时间: 2023-03-08 17:37:40

testcontainers/testcontainers-dotnet最新发布版本:3.6.0(2023-11-11 03:49:34)

What's Changed

We have added and replaced the modules mentioned below. Each module contains its own builder and configuration type, making it much easier to support various test cases. Currently, the modules are designed to quickly spin up common configurations of real dependencies to establish a connection to the application or service running inside it.

We are interested in your opinions and requirements in regards of the module's capabilities. Creating great modules is a community effort, so please consider sharing your thoughts with us and other Testcontainers users in this discussion or in our Slack workspace.

We will continuously add module features and documentation. Currently, information on how to configure and run modules can be found in the tests. If you are already familiar with Testcontainers, you should have no trouble understanding it as the experience is very similar as before. Here is a quick example using xUnit.net:

public sealed class ModuleSupport : IAsyncLifetime
{
    private readonly MsSqlContainer _msSqlContainer = new MsSqlBuilder().Build();

    public Task InitializeAsync()
    {
        return _msSqlContainer.StartAsync();
    }

    public Task DisposeAsync()
    {
        return _msSqlContainer.DisposeAsync().AsTask();
    }

    [Fact]
    public void ConnectionStateReturnsOpen()
    {
        // Given
        using DbConnection connection = new SqlConnection(_msSqlContainer.GetConnectionString());

        // When
        connection.Open();

        // Then
        Assert.Equal(ConnectionState.Open, connection.State);
    }
}

⚠️ Breaking Changes

Old name New name
ITestcontainersContainer, IDockerContainer, IRunningDockerContainer IContainer
IDockerImage IImage
IDockerNetwork INetwork
IDockerVolume IVolume
TestcontainersBuilder ContainerBuilder
TestcontainersContainer DockerContainer
TestcontainersNetworkBuilder NetworkBuilder
TestcontainersVolumeBuilder VolumeBuilder
WithCreateContainerParametersModifier WithCreateParameterModifier

🚀 Features

🐛 Bug Fixes

📖 Documentation

🧹 Housekeeping

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-03-08发行的版本