diff --git a/tests/Testcontainers.BigQuery.Tests/BigQueryContainerTest.cs b/tests/Testcontainers.BigQuery.Tests/BigQueryContainerTest.cs index d06dcabd2..e1d62aee3 100644 --- a/tests/Testcontainers.BigQuery.Tests/BigQueryContainerTest.cs +++ b/tests/Testcontainers.BigQuery.Tests/BigQueryContainerTest.cs @@ -1,19 +1,7 @@ namespace Testcontainers.BigQuery; -public sealed class BigQueryContainerTest : IAsyncLifetime +public sealed class BigQueryContainerTest(ContainerFixture fixture) : IClassFixture> { - private readonly BigQueryContainer _bigQueryContainer = new BigQueryBuilder().Build(); - - public Task InitializeAsync() - { - return _bigQueryContainer.StartAsync(); - } - - public Task DisposeAsync() - { - return _bigQueryContainer.DisposeAsync().AsTask(); - } - [Fact] [Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] public async Task ExecuteQueryReturnsInsertRow() @@ -26,7 +14,7 @@ public async Task ExecuteQueryReturnsInsertRow() var utcNowWithoutMilliseconds = new DateTime(utcNow.Year, utcNow.Month, utcNow.Day, utcNow.Hour, utcNow.Minute, utcNow.Second, DateTimeKind.Utc); var bigQueryClientBuilder = new BigQueryClientBuilder(); - bigQueryClientBuilder.BaseUri = _bigQueryContainer.GetEmulatorEndpoint(); + bigQueryClientBuilder.BaseUri = fixture.Container.GetEmulatorEndpoint(); bigQueryClientBuilder.ProjectId = BigQueryBuilder.DefaultProjectId; bigQueryClientBuilder.Credential = new Credential(); diff --git a/tests/Testcontainers.BigQuery.Tests/Testcontainers.BigQuery.Tests.csproj b/tests/Testcontainers.BigQuery.Tests/Testcontainers.BigQuery.Tests.csproj index 55c66b28d..8bfa7f69e 100644 --- a/tests/Testcontainers.BigQuery.Tests/Testcontainers.BigQuery.Tests.csproj +++ b/tests/Testcontainers.BigQuery.Tests/Testcontainers.BigQuery.Tests.csproj @@ -13,6 +13,7 @@ + \ No newline at end of file diff --git a/tests/Testcontainers.BigQuery.Tests/Usings.cs b/tests/Testcontainers.BigQuery.Tests/Usings.cs index e8c0374a0..eeda6669f 100644 --- a/tests/Testcontainers.BigQuery.Tests/Usings.cs +++ b/tests/Testcontainers.BigQuery.Tests/Usings.cs @@ -1,9 +1,10 @@ global using System; global using System.Linq; +global using System.Threading; global using System.Threading.Tasks; global using DotNet.Testcontainers.Commons; -global using Google.Cloud.BigQuery.V2; -global using Xunit; -global using System.Threading; global using Google.Apis.Auth.OAuth2; -global using Google.Apis.Http; \ No newline at end of file +global using Google.Apis.Http; +global using Google.Cloud.BigQuery.V2; +global using Testcontainers.Xunit; +global using Xunit; \ No newline at end of file