-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
…while starting an existing container
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace DotNet.Testcontainers.Commons; | ||
|
||
[PublicAPI] | ||
public abstract class SharedContainerInstance<TContainer> : IAsyncLifetime | ||
where TContainer : IContainer | ||
{ | ||
public SharedContainerInstance(TContainer container) | ||
{ | ||
Container = container; | ||
} | ||
|
||
public TContainer Container { get; } | ||
|
||
public Task InitializeAsync() | ||
{ | ||
return Container.StartAsync(); | ||
} | ||
|
||
public Task DisposeAsync() | ||
{ | ||
return Container.DisposeAsync().AsTask(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
global using System; | ||
global using System; | ||
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (windows-2022)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (windows-2022)
Check warning on line 2 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (windows-2022)
|
||
global using System.Diagnostics; | ||
global using System.IO; | ||
global using System.Text; | ||
global using System.Threading.Tasks; | ||
global using DotNet.Testcontainers.Containers; | ||
global using DotNet.Testcontainers.Images; | ||
global using JetBrains.Annotations; | ||
global using JetBrains.Annotations; | ||
global using JetBrains.Annotations; | ||
Check warning on line 10 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 10 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 10 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (ubuntu-22.04)
Check warning on line 10 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (windows-2022)
Check warning on line 10 in tests/Testcontainers.Commons/Usings.cs GitHub Actions / build (windows-2022)
|
||
global using Xunit; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
global using System; | ||
global using System.Data; | ||
global using System.Data.Common; | ||
global using System.Threading; | ||
global using System.Threading.Tasks; | ||
global using DotNet.Testcontainers.Commons; | ||
global using JetBrains.Annotations; | ||
global using Npgsql; | ||
global using Xunit; |