Skip to content

Commit 5f4c1fa

Browse files
XUnit V3 2.0.1 as default test-framework
1 parent 26dbdcc commit 5f4c1fa

156 files changed

Lines changed: 621 additions & 572 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/Testcontainers.ActiveMq.Tests/ArtemisContainerTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ private ArtemisContainerTest(ArtemisContainer artemisContainer, string username,
1616
_password = password;
1717
}
1818

19-
public Task InitializeAsync()
19+
public async ValueTask InitializeAsync()
2020
{
21-
return _artemisContainer.StartAsync();
21+
await _artemisContainer.StartAsync();
2222
}
2323

24-
public Task DisposeAsync()
24+
public ValueTask DisposeAsync()
2525
{
26-
return _artemisContainer.DisposeAsync().AsTask();
26+
return _artemisContainer.DisposeAsync();
2727
}
2828
// # --8<-- [end:UseArtemisContainer]
2929

tests/Testcontainers.ActiveMq.Tests/Testcontainers.ActiveMq.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
<TargetFrameworks>net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<IsPublishable>false</IsPublishable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<!-- -8<- [start:PackageReferences] -->
910
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
1011
<PackageReference Include="coverlet.collector"/>
1112
<PackageReference Include="xunit.runner.visualstudio"/>
12-
<PackageReference Include="xunit"/>
13+
<PackageReference Include="xunit.v3"/>
1314
<PackageReference Include="Apache.NMS.ActiveMQ"/>
1415
<!-- -8<- [end:PackageReferences] -->
1516
</ItemGroup>

tests/Testcontainers.ArangoDb.Tests/ArangoDbContainerTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ public sealed class ArangoDbContainerTest : IAsyncLifetime
44
{
55
private readonly ArangoDbContainer _arangoDbContainer = new ArangoDbBuilder().Build();
66

7-
public Task InitializeAsync()
7+
public async ValueTask InitializeAsync()
88
{
9-
return _arangoDbContainer.StartAsync();
9+
await _arangoDbContainer.StartAsync();
1010
}
1111

12-
public Task DisposeAsync()
12+
public ValueTask DisposeAsync()
1313
{
14-
return _arangoDbContainer.DisposeAsync().AsTask();
14+
return _arangoDbContainer.DisposeAsync();
1515
}
1616

1717
[Fact]
@@ -26,7 +26,7 @@ public async Task RetrievesDatabases()
2626
using var client = new ArangoDBClient(transport);
2727

2828
// When
29-
var response = await client.Database.GetDatabasesAsync()
29+
var response = await client.Database.GetDatabasesAsync(TestContext.Current.CancellationToken)
3030
.ConfigureAwait(true);
3131

3232
// Then

tests/Testcontainers.ArangoDb.Tests/Testcontainers.ArangoDb.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<TargetFrameworks>net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<IsPublishable>false</IsPublishable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
910
<PackageReference Include="coverlet.collector"/>
1011
<PackageReference Include="xunit.runner.visualstudio"/>
11-
<PackageReference Include="xunit"/>
12+
<PackageReference Include="xunit.v3"/>
1213
<PackageReference Include="ArangoDBNetStandard"/>
1314
</ItemGroup>
1415
<ItemGroup>

tests/Testcontainers.Azurite.Tests/AzuriteContainerTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ private AzuriteContainerTest(AzuriteContainer azuriteContainer)
99
_azuriteContainer = azuriteContainer;
1010
}
1111

12-
public Task InitializeAsync()
12+
public async ValueTask InitializeAsync()
1313
{
14-
return _azuriteContainer.StartAsync();
14+
await _azuriteContainer.StartAsync();
1515
}
1616

17-
public Task DisposeAsync()
17+
public ValueTask DisposeAsync()
1818
{
19-
return _azuriteContainer.DisposeAsync().AsTask();
19+
return _azuriteContainer.DisposeAsync();
2020
}
2121

2222
[Fact]
@@ -27,7 +27,7 @@ public async Task EstablishesBlobServiceConnection()
2727
var client = new BlobServiceClient(_azuriteContainer.GetConnectionString());
2828

2929
// When
30-
var properties = await client.GetPropertiesAsync()
30+
var properties = await client.GetPropertiesAsync(TestContext.Current.CancellationToken)
3131
.ConfigureAwait(true);
3232

3333
// Then
@@ -42,7 +42,7 @@ public async Task EstablishesQueueServiceConnection()
4242
var client = new QueueServiceClient(_azuriteContainer.GetConnectionString());
4343

4444
// When
45-
var properties = await client.GetPropertiesAsync()
45+
var properties = await client.GetPropertiesAsync(TestContext.Current.CancellationToken)
4646
.ConfigureAwait(true);
4747

4848
// Then
@@ -57,7 +57,7 @@ public async Task EstablishesTableServiceConnection()
5757
var client = new TableServiceClient(_azuriteContainer.GetConnectionString());
5858

5959
// When
60-
var properties = await client.GetPropertiesAsync()
60+
var properties = await client.GetPropertiesAsync(TestContext.Current.CancellationToken)
6161
.ConfigureAwait(true);
6262

6363
// Then
@@ -106,7 +106,7 @@ public AzuriteMemoryLimitConfiguration()
106106
public async Task MemoryLimitIsConfigured()
107107
{
108108
// Given
109-
var (stdout, _) = await _azuriteContainer.GetLogsAsync(timestampsEnabled: false)
109+
var (stdout, _) = await _azuriteContainer.GetLogsAsync(timestampsEnabled: false, ct: TestContext.Current.CancellationToken)
110110
.ConfigureAwait(true);
111111

112112
// When

tests/Testcontainers.Azurite.Tests/Testcontainers.Azurite.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<TargetFrameworks>net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<IsPublishable>false</IsPublishable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
910
<PackageReference Include="coverlet.collector"/>
1011
<PackageReference Include="xunit.runner.visualstudio"/>
11-
<PackageReference Include="xunit"/>
12+
<PackageReference Include="xunit.v3"/>
1213
<PackageReference Include="Azure.Data.Tables"/>
1314
<PackageReference Include="Azure.Storage.Blobs"/>
1415
<PackageReference Include="Azure.Storage.Queues"/>

tests/Testcontainers.BigQuery.Tests/BigQueryContainerTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ public sealed class BigQueryContainerTest : IAsyncLifetime
44
{
55
private readonly BigQueryContainer _bigQueryContainer = new BigQueryBuilder().Build();
66

7-
public Task InitializeAsync()
7+
public async ValueTask InitializeAsync()
88
{
9-
return _bigQueryContainer.StartAsync();
9+
await _bigQueryContainer.StartAsync();
1010
}
1111

12-
public Task DisposeAsync()
12+
public ValueTask DisposeAsync()
1313
{
14-
return _bigQueryContainer.DisposeAsync().AsTask();
14+
return _bigQueryContainer.DisposeAsync();
1515
}
1616

1717
[Fact]
@@ -41,20 +41,20 @@ public async Task ExecuteQueryReturnsInsertRow()
4141
expectedRow.Add("gameStarted", utcNowWithoutMilliseconds);
4242
expectedRow.Add("score", 85L);
4343

44-
using var bigQueryClient = await bigQueryClientBuilder.BuildAsync()
44+
using var bigQueryClient = await bigQueryClientBuilder.BuildAsync(TestContext.Current.CancellationToken)
4545
.ConfigureAwait(true);
4646

47-
var dataset = await bigQueryClient.GetOrCreateDatasetAsync("mydata")
47+
var dataset = await bigQueryClient.GetOrCreateDatasetAsync("mydata", cancellationToken: TestContext.Current.CancellationToken)
4848
.ConfigureAwait(true);
4949

5050
// When
51-
var table = await dataset.CreateTableAsync("scores", tableSchema)
51+
var table = await dataset.CreateTableAsync("scores", tableSchema, cancellationToken: TestContext.Current.CancellationToken)
5252
.ConfigureAwait(true);
5353

54-
_ = await table.InsertRowAsync(expectedRow)
54+
_ = await table.InsertRowAsync(expectedRow, cancellationToken: TestContext.Current.CancellationToken)
5555
.ConfigureAwait(true);
5656

57-
var results = await bigQueryClient.ExecuteQueryAsync($"SELECT * FROM {table}", null)
57+
var results = await bigQueryClient.ExecuteQueryAsync($"SELECT * FROM {table}", null, cancellationToken: TestContext.Current.CancellationToken)
5858
.ConfigureAwait(true);
5959

6060
// Then

tests/Testcontainers.BigQuery.Tests/Testcontainers.BigQuery.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<TargetFrameworks>net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<IsPublishable>false</IsPublishable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
910
<PackageReference Include="coverlet.collector"/>
1011
<PackageReference Include="xunit.runner.visualstudio"/>
11-
<PackageReference Include="xunit"/>
12+
<PackageReference Include="xunit.v3"/>
1213
<PackageReference Include="Google.Cloud.BigQuery.V2"/>
1314
</ItemGroup>
1415
<ItemGroup>

tests/Testcontainers.Bigtable.Tests/BigtableContainerTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ public sealed class BigtableContainerTest : IAsyncLifetime
44
{
55
private readonly BigtableContainer _bigtableContainer = new BigtableBuilder().Build();
66

7-
public Task InitializeAsync()
7+
public async ValueTask InitializeAsync()
88
{
9-
return _bigtableContainer.StartAsync();
9+
await _bigtableContainer.StartAsync();
1010
}
1111

12-
public Task DisposeAsync()
12+
public ValueTask DisposeAsync()
1313
{
14-
return _bigtableContainer.DisposeAsync().AsTask();
14+
return _bigtableContainer.DisposeAsync();
1515
}
1616

1717
[Fact]
@@ -42,7 +42,7 @@ public async Task GetTableReturnsCreateTable()
4242
bigtableClientBuilder.ChannelCredentials = ChannelCredentials.Insecure;
4343

4444
// When
45-
var bigtableClient = await bigtableClientBuilder.BuildAsync()
45+
var bigtableClient = await bigtableClientBuilder.BuildAsync(TestContext.Current.CancellationToken)
4646
.ConfigureAwait(true);
4747

4848
_ = await bigtableClient.CreateTableAsync(instanceName, tableName.TableId, table)

tests/Testcontainers.Bigtable.Tests/Testcontainers.Bigtable.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<TargetFrameworks>net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
<IsPublishable>false</IsPublishable>
6+
<OutputType>Exe</OutputType>
67
</PropertyGroup>
78
<ItemGroup>
89
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
910
<PackageReference Include="coverlet.collector"/>
1011
<PackageReference Include="xunit.runner.visualstudio"/>
11-
<PackageReference Include="xunit"/>
12+
<PackageReference Include="xunit.v3"/>
1213
<PackageReference Include="Google.Cloud.Bigtable.Admin.V2"/>
1314
</ItemGroup>
1415
<ItemGroup>

0 commit comments

Comments
 (0)