File tree Expand file tree Collapse file tree 4 files changed +29
-11
lines changed
Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net8 .0</TargetFramework >
4+ <TargetFramework >net9 .0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77
1010 </PropertyGroup >
1111
1212 <ItemGroup >
13- <PackageReference Include =" coverlet.collector" Version =" 6.0.0" />
14- <PackageReference Include =" FluentAssertions" Version =" 6.12.2" />
15- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.8.0" />
13+ <PackageReference Include =" coverlet.collector" Version =" 6.0.2" >
14+ <PrivateAssets >all</PrivateAssets >
15+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
16+ </PackageReference >
17+ <PackageReference Include =" FluentAssertions" Version =" 7.0.0" />
18+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.12.0" />
1619 <PackageReference Include =" Testcontainers.PostgreSql" Version =" 4.0.0" />
17- <PackageReference Include =" xunit" Version =" 2.5.3" />
18- <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.5.3" />
20+ <PackageReference Include =" xunit" Version =" 2.9.2" />
21+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.8.2" >
22+ <PrivateAssets >all</PrivateAssets >
23+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
24+ </PackageReference >
1925 </ItemGroup >
2026
2127 <ItemGroup >
Original file line number Diff line number Diff line change 1+ using DotNet . Testcontainers . Builders ;
12using FluentAssertions ;
23using Testcontainers . PostgreSql ;
34
@@ -6,12 +7,16 @@ namespace CustomerService.Tests;
67public sealed class CustomerServiceTest : IAsyncLifetime
78{
89 private readonly PostgreSqlContainer _postgres = new PostgreSqlBuilder ( )
9- . WithImage ( "postgres:15-alpine" )
10+ . WithImage ( "postgres:latest" )
11+ . WithWaitStrategy ( Wait . ForUnixContainer ( ) . UntilPortIsAvailable ( 5432 ) )
1012 . Build ( ) ;
1113
12- public Task InitializeAsync ( )
14+ public async Task InitializeAsync ( )
1315 {
14- return _postgres . StartAsync ( ) ;
16+ // return _postgres.StartAsync();
17+ Console . WriteLine ( $ "Starting container with ID: { _postgres . Id } ") ;
18+ await _postgres . StartAsync ( ) ;
19+ Console . WriteLine ( $ "Container { _postgres . Id } started.") ;
1520 }
1621
1722 public Task DisposeAsync ( )
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net8 .0</TargetFramework >
4+ <TargetFramework >net9 .0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 </PropertyGroup >
88
99 <ItemGroup >
10- <PackageReference Include =" Npgsql" Version =" 8 .0.5 " />
10+ <PackageReference Include =" Npgsql" Version =" 9 .0.1 " />
1111 </ItemGroup >
1212
1313</Project >
Original file line number Diff line number Diff line change 1+ {
2+ "sdk" : {
3+ "version" : " 9.0.0" ,
4+ "rollForward" : " latestMajor" ,
5+ "allowPrerelease" : true
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments