@@ -12,10 +12,16 @@ public IConfigOperationsTests(TestFixture testFixture, ITestOutputHelper testOut
1212 _testOutputHelper = testOutputHelper ;
1313 }
1414
15- [ Fact ]
16- public async Task SwarmConfig_CanCreateAndRead ( )
15+ public static IEnumerable < object [ ] > GetDockerClientTypes ( ) =>
16+ Enum . GetValues ( typeof ( DockerClientType ) )
17+ . Cast < DockerClientType > ( )
18+ . Select ( t => new object [ ] { t } ) ;
19+
20+ [ Theory ]
21+ [ MemberData ( nameof ( GetDockerClientTypes ) ) ]
22+ public async Task SwarmConfig_CanCreateAndRead ( DockerClientType clientType )
1723 {
18- var currentConfigs = await _testFixture . DockerClient . Configs . ListConfigsAsync ( ) ;
24+ var currentConfigs = await _testFixture . DockerClients [ clientType ] . Configs . ListConfigsAsync ( ) ;
1925
2026 _testOutputHelper . WriteLine ( $ "Current Configs: { currentConfigs . Count } ") ;
2127
@@ -31,15 +37,15 @@ public async Task SwarmConfig_CanCreateAndRead()
3137 Config = testConfigSpec
3238 } ;
3339
34- var createdConfig = await _testFixture . DockerClient . Configs . CreateConfigAsync ( configParameters ) ;
40+ var createdConfig = await _testFixture . DockerClients [ clientType ] . Configs . CreateConfigAsync ( configParameters ) ;
3541 Assert . NotNull ( createdConfig . ID ) ;
3642 _testOutputHelper . WriteLine ( $ "Config created: { createdConfig . ID } ") ;
3743
38- var configs = await _testFixture . DockerClient . Configs . ListConfigsAsync ( ) ;
44+ var configs = await _testFixture . DockerClients [ clientType ] . Configs . ListConfigsAsync ( ) ;
3945 Assert . Contains ( configs , c => c . ID == createdConfig . ID ) ;
4046 _testOutputHelper . WriteLine ( $ "Current Configs: { configs . Count } ") ;
4147
42- var configResponse = await _testFixture . DockerClient . Configs . InspectConfigAsync ( createdConfig . ID ) ;
48+ var configResponse = await _testFixture . DockerClients [ clientType ] . Configs . InspectConfigAsync ( createdConfig . ID ) ;
4349
4450 Assert . NotNull ( configResponse ) ;
4551
@@ -51,8 +57,8 @@ public async Task SwarmConfig_CanCreateAndRead()
5157
5258 _testOutputHelper . WriteLine ( "Config created is the same." ) ;
5359
54- await _testFixture . DockerClient . Configs . RemoveConfigAsync ( createdConfig . ID ) ;
60+ await _testFixture . DockerClients [ clientType ] . Configs . RemoveConfigAsync ( createdConfig . ID ) ;
5561
56- await Assert . ThrowsAsync < DockerApiException > ( ( ) => _testFixture . DockerClient . Configs . InspectConfigAsync ( createdConfig . ID ) ) ;
62+ await Assert . ThrowsAsync < DockerApiException > ( ( ) => _testFixture . DockerClients [ clientType ] . Configs . InspectConfigAsync ( createdConfig . ID ) ) ;
5763 }
5864}
0 commit comments