Skip to content

Commit

Permalink
[#96] #EXTEND 'assemblyName: DotNet.Testcontainers.Test; function: Te…
Browse files Browse the repository at this point in the history
…stcontainersContainerTest'

{Add a test to query the enabled Docker engine.}
  • Loading branch information
HofmeisterAn committed Jun 16, 2019
1 parent 3fdac9b commit 12b7e9a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public static class TestcontainersContainerTest

public class With
{
[Fact]
public void IsLinuxEngineEnabled()
{
Assert.False(DockerHostConfiguration.IsWindowsEngineEnabled);
}

[Fact]
public async Task Finalizer()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ namespace DotNet.Testcontainers.Tests.Unit.Windows

public class TestcontainersContainerTest
{
[IgnoreOnLinuxEngine]
public void IsWindowsEngineEnabled()
public class With
{
Assert.True(DockerHostConfiguration.IsWindowsEngineEnabled);
}

[IgnoreOnLinuxEngine]
public async Task Disposable()
{
// Given
// When
var testcontainersBuilder = new TestcontainersBuilder<TestcontainersContainer>()
.WithImage("mcr.microsoft.com/windows/nanoserver:1809");
[IgnoreOnLinuxEngine]
public void IsWindowsEngineEnabled()
{
Assert.True(DockerHostConfiguration.IsWindowsEngineEnabled);
}

// Then
using (var testcontainer = testcontainersBuilder.Build())
[IgnoreOnLinuxEngine]
public async Task Disposable()
{
await testcontainer.StartAsync();
// Given
// When
var testcontainersBuilder = new TestcontainersBuilder<TestcontainersContainer>()
.WithImage("mcr.microsoft.com/windows/nanoserver:1809");

// Then
using (var testcontainer = testcontainersBuilder.Build())
{
await testcontainer.StartAsync();
}
}
}
}
Expand Down

0 comments on commit 12b7e9a

Please sign in to comment.