예제 #1
0
        public void ThreeContainer_NoError()
        {
            //Act
            Action action = () =>
            {
                MongoResource mongo = _resource.GetResource <MongoResource>("mongo");
            };

            //Assert
            action.Should().NotThrow();
        }
예제 #2
0
        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();
        }
예제 #3
0
 public MongoInitOptionResourceTests(MongoResource <FileInitOptions> mongoResource)
 {
     _mongoResource = mongoResource;
 }