Skip to content

Commit c9f41f3

Browse files
author
Oleksii Sokol
committed
mongo tests
1 parent 2a510d7 commit c9f41f3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ManagedCode.Database.Tests/TestContainers/MongoDBTestContainer.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ public async Task InitializeAsync()
7979

8080
publicPort = containerListResponse.Ports.Single(port => port.PrivatePort == privatePort).PublicPort;
8181

82+
/*if(containerListResponse.State == "exited")
83+
{
84+
await _dockerClient.Containers.StartContainerAsync(containerId, new ContainerStartParameters());
85+
}*/
8286
}
8387

8488
_dbDatabase = new MongoDBDatabase(new MongoDBOptions()
@@ -104,9 +108,13 @@ public async Task DisposeAsync()
104108

105109
public async void Dispose()
106110
{
107-
await _dockerClient.Containers.StopContainerAsync(containerId, new ContainerStopParameters());
111+
//await _dockerClient.Containers.StopContainerAsync(containerId, new ContainerStopParameters());
108112

109-
await _dockerClient.Containers.RemoveContainerAsync(containerId, new ContainerRemoveParameters());
113+
await _dockerClient.Containers.RemoveContainerAsync(containerId,
114+
new ContainerRemoveParameters
115+
{
116+
Force = true
117+
});
110118

111119
}
112120
}

0 commit comments

Comments
 (0)