public void ThreeContainer_NoError() { //Act Action action = () => { MongoResource mongo = _resource.GetResource <MongoResource>("mongo"); }; //Assert action.Should().NotThrow(); }
public async Task TwoContainer_Network_BothInSameNetwork() { MongoResource mongoResource = _resource.GetResource <MongoResource>("mongo"); string connectionString = mongoResource.GetComposeExports()["CONNECTIONSTRING_INTERNAL"]; string containerName = GetNameFromConnectionString(connectionString); IList <ContainerListResponse> response = (await _dockerClient.Containers.ListContainersAsync( new ContainersListParameters())); ContainerListResponse container = response.Where(c => c.Names.Contains($"/{containerName}")).Single(); string networkName = container.NetworkSettings.Networks.Keys.Where(n => n.Contains("squa_network")).Single(); NetworkResponse network = (await _dockerClient.Networks.ListNetworksAsync()).Where(n => n.Name == networkName).SingleOrDefault(); network.Should().NotBeNull(); }
public MongoInitOptionResourceTests(MongoResource <FileInitOptions> mongoResource) { _mongoResource = mongoResource; }