diff --git a/tests/Testcontainers.Commons/SharedContainerInstance.cs b/tests/Testcontainers.Commons/SharedContainerInstance.cs deleted file mode 100644 index 53a3debd6..000000000 --- a/tests/Testcontainers.Commons/SharedContainerInstance.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace DotNet.Testcontainers.Commons; - -[PublicAPI] -public abstract class SharedContainerInstance : 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(); - } -} \ No newline at end of file diff --git a/tests/Testcontainers.Commons/Testcontainers.Commons.csproj b/tests/Testcontainers.Commons/Testcontainers.Commons.csproj index 78bc7ffd3..33932eacf 100644 --- a/tests/Testcontainers.Commons/Testcontainers.Commons.csproj +++ b/tests/Testcontainers.Commons/Testcontainers.Commons.csproj @@ -9,7 +9,6 @@ - diff --git a/tests/Testcontainers.Commons/Usings.cs b/tests/Testcontainers.Commons/Usings.cs index 661aa4f12..904e633f5 100644 --- a/tests/Testcontainers.Commons/Usings.cs +++ b/tests/Testcontainers.Commons/Usings.cs @@ -2,8 +2,5 @@ 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 Xunit; \ No newline at end of file +global using JetBrains.Annotations; \ No newline at end of file diff --git a/tests/Testcontainers.PostgreSql.Tests/PostgreSqlContainerTest.cs b/tests/Testcontainers.PostgreSql.Tests/PostgreSqlContainerTest.cs index e797eaaa3..7488c8312 100644 --- a/tests/Testcontainers.PostgreSql.Tests/PostgreSqlContainerTest.cs +++ b/tests/Testcontainers.PostgreSql.Tests/PostgreSqlContainerTest.cs @@ -46,13 +46,13 @@ public async Task ExecScriptReturnsSuccessful() } // # --8<-- [end:UsePostgreSqlContainer] - public sealed class ReuseContainerTest : IClassFixture, IDisposable + public sealed class ReuseContainerTest : IClassFixture, IDisposable { private readonly CancellationTokenSource _cts = new CancellationTokenSource(TimeSpan.FromMinutes(1)); - private readonly SharedContainerInstance _fixture; + private readonly PostgreSqlFixture _fixture; - public ReuseContainerTest(SharedPostgreSqlInstance fixture) + public ReuseContainerTest(PostgreSqlFixture fixture) { _fixture = fixture; } @@ -79,10 +79,10 @@ await _fixture.Container.StartAsync(_cts.Token) } [UsedImplicitly] - public sealed class SharedPostgreSqlInstance : SharedContainerInstance + public sealed class PostgreSqlFixture : ContainerFixture { - public SharedPostgreSqlInstance() - : base(new PostgreSqlBuilder().Build()) + public PostgreSqlFixture(IMessageSink messageSink) + : base(messageSink) { } } diff --git a/tests/Testcontainers.PostgreSql.Tests/Testcontainers.PostgreSql.Tests.csproj b/tests/Testcontainers.PostgreSql.Tests/Testcontainers.PostgreSql.Tests.csproj index 4e0e76e9a..8b7a02904 100644 --- a/tests/Testcontainers.PostgreSql.Tests/Testcontainers.PostgreSql.Tests.csproj +++ b/tests/Testcontainers.PostgreSql.Tests/Testcontainers.PostgreSql.Tests.csproj @@ -15,6 +15,7 @@ + \ No newline at end of file diff --git a/tests/Testcontainers.PostgreSql.Tests/Usings.cs b/tests/Testcontainers.PostgreSql.Tests/Usings.cs index a7c5d950c..2d2ea46e3 100644 --- a/tests/Testcontainers.PostgreSql.Tests/Usings.cs +++ b/tests/Testcontainers.PostgreSql.Tests/Usings.cs @@ -6,4 +6,6 @@ global using DotNet.Testcontainers.Commons; global using JetBrains.Annotations; global using Npgsql; -global using Xunit; \ No newline at end of file +global using Testcontainers.Xunit; +global using Xunit; +global using Xunit.Abstractions; \ No newline at end of file