@@ -4,16 +4,13 @@ namespace Testcontainers.ServiceBus;
44[ PublicAPI ]
55public sealed class ServiceBusContainer : DockerContainer
66{
7- private readonly ServiceBusConfiguration _configuration ;
8-
97 /// <summary>
108 /// Initializes a new instance of the <see cref="ServiceBusContainer" /> class.
119 /// </summary>
1210 /// <param name="configuration">The container configuration.</param>
1311 public ServiceBusContainer ( ServiceBusConfiguration configuration )
1412 : base ( configuration )
1513 {
16- _configuration = configuration ;
1714 }
1815
1916 /// <summary>
@@ -29,40 +26,4 @@ public string GetConnectionString()
2926 properties . Add ( "UseDevelopmentEmulator" , "true" ) ;
3027 return string . Join ( ";" , properties . Select ( property => string . Join ( "=" , property . Key , property . Value ) ) ) ;
3128 }
32-
33- /// <inheritdoc />
34- protected override async Task UnsafeCreateAsync ( CancellationToken ct = default )
35- {
36- await _configuration . Networks . Single ( ) . CreateAsync ( ct )
37- . ConfigureAwait ( false ) ;
38-
39- await base . UnsafeCreateAsync ( ct )
40- . ConfigureAwait ( false ) ;
41- }
42-
43- /// <inheritdoc />
44- protected override Task UnsafeDeleteAsync ( CancellationToken ct = default )
45- {
46- return Task . WhenAll ( base . UnsafeDeleteAsync ( ct ) , _configuration . DatabaseContainer . DisposeAsync ( ) . AsTask ( ) ) ;
47- }
48-
49- /// <inheritdoc />
50- protected override async Task UnsafeStartAsync ( CancellationToken ct = default )
51- {
52- await _configuration . DatabaseContainer . StartAsync ( ct )
53- . ConfigureAwait ( false ) ;
54-
55- await base . UnsafeStartAsync ( ct )
56- . ConfigureAwait ( false ) ;
57- }
58-
59- /// <inheritdoc />
60- protected override async Task UnsafeStopAsync ( CancellationToken ct = default )
61- {
62- await base . UnsafeStopAsync ( ct )
63- . ConfigureAwait ( false ) ;
64-
65- await _configuration . DatabaseContainer . StopAsync ( ct )
66- . ConfigureAwait ( false ) ;
67- }
6829}
0 commit comments