diff --git a/.editorconfig b/.editorconfig index b82f26a..dc00274 100644 --- a/.editorconfig +++ b/.editorconfig @@ -174,3 +174,6 @@ dotnet_diagnostic.ca1812.severity = none dotnet_diagnostic.ca1819.severity = none dotnet_diagnostic.ca1014.severity = none + +# Because an application's API isn't typically referenced from outside the assembly, types can be made internal +dotnet_diagnostic.CA1515.severity = none \ No newline at end of file diff --git a/Examples/AngularAuth/AngularAuth.Backend.Sut/AngularAuth.Backend.Sut.csproj b/Examples/AngularAuth/AngularAuth.Backend.Sut/AngularAuth.Backend.Sut.csproj index 29532a8..298472b 100644 --- a/Examples/AngularAuth/AngularAuth.Backend.Sut/AngularAuth.Backend.Sut.csproj +++ b/Examples/AngularAuth/AngularAuth.Backend.Sut/AngularAuth.Backend.Sut.csproj @@ -1,21 +1,21 @@ - net8.0 + net9.0 enable enable - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Examples/AngularAuth/AngularAuth.Playwright/AngularAuth.Playwright.csproj b/Examples/AngularAuth/AngularAuth.Playwright/AngularAuth.Playwright.csproj index dd9da27..2240092 100644 --- a/Examples/AngularAuth/AngularAuth.Playwright/AngularAuth.Playwright.csproj +++ b/Examples/AngularAuth/AngularAuth.Playwright/AngularAuth.Playwright.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,17 +10,17 @@ - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/AngularAuth/AngularAuth.Playwright/TestSetup/TestJwtGenerator.cs b/Examples/AngularAuth/AngularAuth.Playwright/TestSetup/TestJwtGenerator.cs index c46bc7c..c0dbc3b 100644 --- a/Examples/AngularAuth/AngularAuth.Playwright/TestSetup/TestJwtGenerator.cs +++ b/Examples/AngularAuth/AngularAuth.Playwright/TestSetup/TestJwtGenerator.cs @@ -31,7 +31,7 @@ public static string GenerateJwtToken(IEnumerable claims) public static IServiceCollection ConfigureTestJwt(this IServiceCollection services) { - services.RemoveAll(typeof(IConfigureOptions)); // Remove any already configured jwt bearer options configurators as we want to be in control of this in the tests. + services.RemoveAll>(); // Remove any already configured jwt bearer options configurators as we want to be in control of this in the tests. services.Configure(JwtBearerDefaults.AuthenticationScheme, options => { options.Configuration = new OpenIdConnectConfiguration diff --git a/Examples/Api/MsSql/Api.MsSql.Nunit/Api.MsSql.Nunit.csproj b/Examples/Api/MsSql/Api.MsSql.Nunit/Api.MsSql.Nunit.csproj index 5453720..977b42a 100644 --- a/Examples/Api/MsSql/Api.MsSql.Nunit/Api.MsSql.Nunit.csproj +++ b/Examples/Api/MsSql/Api.MsSql.Nunit/Api.MsSql.Nunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,16 +10,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/Api/MsSql/Api.MsSql.Sut/Api.MsSql.Sut.csproj b/Examples/Api/MsSql/Api.MsSql.Sut/Api.MsSql.Sut.csproj index 42a21c3..877bb59 100644 --- a/Examples/Api/MsSql/Api.MsSql.Sut/Api.MsSql.Sut.csproj +++ b/Examples/Api/MsSql/Api.MsSql.Sut/Api.MsSql.Sut.csproj @@ -1,20 +1,20 @@ - net8.0 + net9.0 enable enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Examples/Api/MsSql/Api.MsSql.Xunit/Api.MsSql.Xunit.csproj b/Examples/Api/MsSql/Api.MsSql.Xunit/Api.MsSql.Xunit.csproj index 81d3763..2055f36 100644 --- a/Examples/Api/MsSql/Api.MsSql.Xunit/Api.MsSql.Xunit.csproj +++ b/Examples/Api/MsSql/Api.MsSql.Xunit/Api.MsSql.Xunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,20 +10,20 @@ - - - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all + diff --git a/Examples/Api/MsSql/Api.MsSql.Xunit/ApiMsSqlTests.cs b/Examples/Api/MsSql/Api.MsSql.Xunit/ApiMsSqlTests.cs index b7e9b66..8237aa3 100644 --- a/Examples/Api/MsSql/Api.MsSql.Xunit/ApiMsSqlTests.cs +++ b/Examples/Api/MsSql/Api.MsSql.Xunit/ApiMsSqlTests.cs @@ -25,7 +25,7 @@ public async Task GetBlogs_ShouldReturnExpectedBlogs() }); //Act - var result = await _sut.CreateClient().GetFromJsonAsync("blogs"); + var result = await _sut.CreateClient().GetFromJsonAsync("blogs", cancellationToken: TestContext.Current.CancellationToken); //Assert result.Should().BeEquivalentTo(new[] diff --git a/Examples/Api/PostgreSql/Api.PostgreSql.Nunit/Api.PostgreSql.Nunit.csproj b/Examples/Api/PostgreSql/Api.PostgreSql.Nunit/Api.PostgreSql.Nunit.csproj index 3678d83..67210a4 100644 --- a/Examples/Api/PostgreSql/Api.PostgreSql.Nunit/Api.PostgreSql.Nunit.csproj +++ b/Examples/Api/PostgreSql/Api.PostgreSql.Nunit/Api.PostgreSql.Nunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,16 +10,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/Api/PostgreSql/Api.PostgreSql.Sut/Api.PostgreSql.Sut.csproj b/Examples/Api/PostgreSql/Api.PostgreSql.Sut/Api.PostgreSql.Sut.csproj index 61b86d2..f20a8fa 100644 --- a/Examples/Api/PostgreSql/Api.PostgreSql.Sut/Api.PostgreSql.Sut.csproj +++ b/Examples/Api/PostgreSql/Api.PostgreSql.Sut/Api.PostgreSql.Sut.csproj @@ -1,20 +1,20 @@ - net8.0 + net9.0 enable enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/Api.PostgreSql.Xunit.csproj b/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/Api.PostgreSql.Xunit.csproj index ef00d2b..7eb39d2 100644 --- a/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/Api.PostgreSql.Xunit.csproj +++ b/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/Api.PostgreSql.Xunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,20 +10,20 @@ - - - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all + diff --git a/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/ApiPostgreSqlTests.cs b/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/ApiPostgreSqlTests.cs index 0f2b517..4f7c24a 100644 --- a/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/ApiPostgreSqlTests.cs +++ b/Examples/Api/PostgreSql/Api.PostgreSql.Xunit/ApiPostgreSqlTests.cs @@ -25,7 +25,7 @@ public async Task GetBlogs_ShouldReturnExpectedBlogs() }); //Act - var result = await _sut.CreateClient().GetFromJsonAsync("blogs"); + var result = await _sut.CreateClient().GetFromJsonAsync("blogs", cancellationToken: TestContext.Current.CancellationToken); //Assert result.Should().BeEquivalentTo(new[] diff --git a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuth.Nunit.csproj b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuth.Nunit.csproj index 5d19f81..55ac758 100644 --- a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuth.Nunit.csproj +++ b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuth.Nunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,16 +10,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuthTests.cs b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuthTests.cs index 6d14ca8..b6f4664 100644 --- a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuthTests.cs +++ b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/ApiJwtAuthTests.cs @@ -23,7 +23,7 @@ public async Task Unauthenticated_Client_ShouldRespondWith401() var result = await Sut.CreateClient().GetAsync("blogs"); //Assert - result.Should().HaveStatusCode(HttpStatusCode.Unauthorized); + result.StatusCode.Should().Be(HttpStatusCode.Unauthorized); } [Test] @@ -42,7 +42,7 @@ public async Task Authenticated_Client_ShouldRespondWith403() var result = await Sut.CreateAuthorizedClient().GetAsync("blogs"); //Assert - result.Should().HaveStatusCode(HttpStatusCode.Forbidden); + result.StatusCode.Should().Be(HttpStatusCode.Forbidden); } [Test] @@ -61,7 +61,7 @@ public async Task Authenticated_And_Authorized_Client_ShouldRespondWith200() var result = await Sut.CreateAuthorizedClient(new Claim("SpecialPermission", string.Empty)).GetAsync("blogs"); //Assert - result.Should().HaveStatusCode(HttpStatusCode.OK); + result.StatusCode.Should().Be(HttpStatusCode.OK); var blogs = await result.Content.ReadFromJsonAsync(); blogs.Should().BeEquivalentTo(new[] diff --git a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/TestSetup/TestJwtGenerator.cs b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/TestSetup/TestJwtGenerator.cs index 1be2b52..836716d 100644 --- a/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/TestSetup/TestJwtGenerator.cs +++ b/Examples/ApiJwtAuth/ApiJwtAuth.Nunit/TestSetup/TestJwtGenerator.cs @@ -31,7 +31,7 @@ public static string GenerateJwtToken(IEnumerable claims) public static IServiceCollection ConfigureTestJwt(this IServiceCollection services) { - services.RemoveAll(typeof(IConfigureOptions)); // Remove any already configured jwt bearer options configurators as we want to be in control of this in the tests. + services.RemoveAll>(); // Remove any already configured jwt bearer options configurators as we want to be in control of this in the tests. services.Configure(JwtBearerDefaults.AuthenticationScheme, options => { options.Configuration = new OpenIdConnectConfiguration diff --git a/Examples/ApiJwtAuth/ApiJwtAuth.Sut/ApiJwtAuth.Sut.csproj b/Examples/ApiJwtAuth/ApiJwtAuth.Sut/ApiJwtAuth.Sut.csproj index d26c761..b3e91ce 100644 --- a/Examples/ApiJwtAuth/ApiJwtAuth.Sut/ApiJwtAuth.Sut.csproj +++ b/Examples/ApiJwtAuth/ApiJwtAuth.Sut/ApiJwtAuth.Sut.csproj @@ -1,21 +1,21 @@ - net8.0 + net9.0 enable enable - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Nunit/Migrations.MsSql.EntityFrameworkCore.Nunit.csproj b/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Nunit/Migrations.MsSql.EntityFrameworkCore.Nunit.csproj index ec1e522..50ef761 100644 --- a/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Nunit/Migrations.MsSql.EntityFrameworkCore.Nunit.csproj +++ b/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Nunit/Migrations.MsSql.EntityFrameworkCore.Nunit.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,16 +10,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Sut/Migrations.MsSql.EntityFrameworkCore.Sut.csproj b/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Sut/Migrations.MsSql.EntityFrameworkCore.Sut.csproj index 42793b9..877bb59 100644 --- a/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Sut/Migrations.MsSql.EntityFrameworkCore.Sut.csproj +++ b/Examples/Migrations.MsSql.EntityFrameworkCore/Migrations.MsSql.EntityFrameworkCore.Sut/Migrations.MsSql.EntityFrameworkCore.Sut.csproj @@ -1,20 +1,20 @@ - net8.0 + net9.0 enable enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/Examples/Razor/Razor.Playwright/Razor.Playwright.csproj b/Examples/Razor/Razor.Playwright/Razor.Playwright.csproj index c3d566e..49aaad6 100644 --- a/Examples/Razor/Razor.Playwright/Razor.Playwright.csproj +++ b/Examples/Razor/Razor.Playwright/Razor.Playwright.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,17 +10,17 @@ - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Examples/Razor/Razor.Sut/Razor.Sut.csproj b/Examples/Razor/Razor.Sut/Razor.Sut.csproj index a751cfa..51d6f55 100644 --- a/Examples/Razor/Razor.Sut/Razor.Sut.csproj +++ b/Examples/Razor/Razor.Sut/Razor.Sut.csproj @@ -1,18 +1,18 @@ - net8.0 + net9.0 enable enable - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Examples/Vue/Vue.Backend.Sut/Vue.Backend.Sut.csproj b/Examples/Vue/Vue.Backend.Sut/Vue.Backend.Sut.csproj index 8bbb029..b87adc3 100644 --- a/Examples/Vue/Vue.Backend.Sut/Vue.Backend.Sut.csproj +++ b/Examples/Vue/Vue.Backend.Sut/Vue.Backend.Sut.csproj @@ -1,20 +1,20 @@ - net8.0 + net9.0 enable enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -22,5 +22,5 @@ false - + diff --git a/Examples/Vue/Vue.Playwright/Vue.Playwright.csproj b/Examples/Vue/Vue.Playwright/Vue.Playwright.csproj index 5065fbe..8b0894a 100644 --- a/Examples/Vue/Vue.Playwright/Vue.Playwright.csproj +++ b/Examples/Vue/Vue.Playwright/Vue.Playwright.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,17 +10,17 @@ - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TestExamplesDotnet.EntityFrameworkCore/TestExamplesDotnet.EntityFrameworkCore.csproj b/TestExamplesDotnet.EntityFrameworkCore/TestExamplesDotnet.EntityFrameworkCore.csproj index c63b940..f23e823 100644 --- a/TestExamplesDotnet.EntityFrameworkCore/TestExamplesDotnet.EntityFrameworkCore.csproj +++ b/TestExamplesDotnet.EntityFrameworkCore/TestExamplesDotnet.EntityFrameworkCore.csproj @@ -1,17 +1,17 @@ - net8.0 + net9.0 enable enable latest - - - - + + + + diff --git a/TestExamplesDotnet.Mssql/MsSqlContainerExtensions.cs b/TestExamplesDotnet.Mssql/MsSqlContainerExtensions.cs index bb9a6c9..fe663a4 100644 --- a/TestExamplesDotnet.Mssql/MsSqlContainerExtensions.cs +++ b/TestExamplesDotnet.Mssql/MsSqlContainerExtensions.cs @@ -17,7 +17,7 @@ await container.CopyAsync(Encoding.Default.GetBytes(scriptContent), scriptFilePa var connectionString = ParseConnectionString(container.GetConnectionString()); return await container - .ExecAsync(new[] { "/opt/mssql-tools/bin/sqlcmd", "-b", "-r", "1", "-U", connectionString.UserId, "-P", connectionString.Password, "-d", database, "-i", scriptFilePath, "-I" }, ct) + .ExecAsync(new[] { "/opt/mssql-tools18/bin/sqlcmd", "-b", "-r", "1", "-U", connectionString.UserId, "-P", connectionString.Password, "-d", database, "-i", scriptFilePath, "-I", "-C" }, ct) .ConfigureAwait(false); } diff --git a/TestExamplesDotnet.Mssql/TestExamplesDotnet.Mssql.csproj b/TestExamplesDotnet.Mssql/TestExamplesDotnet.Mssql.csproj index c155e73..5a098d7 100644 --- a/TestExamplesDotnet.Mssql/TestExamplesDotnet.Mssql.csproj +++ b/TestExamplesDotnet.Mssql/TestExamplesDotnet.Mssql.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -11,7 +11,7 @@ - + diff --git a/TestExamplesDotnet.Nunit/TestExamplesDotnet.Nunit.csproj b/TestExamplesDotnet.Nunit/TestExamplesDotnet.Nunit.csproj index 299d4fd..ed48268 100644 --- a/TestExamplesDotnet.Nunit/TestExamplesDotnet.Nunit.csproj +++ b/TestExamplesDotnet.Nunit/TestExamplesDotnet.Nunit.csproj @@ -1,16 +1,16 @@  - net8.0 + net9.0 enable enable - - - - + + + + diff --git a/TestExamplesDotnet.PostgreSql/TestExamplesDotnet.PostgreSql.csproj b/TestExamplesDotnet.PostgreSql/TestExamplesDotnet.PostgreSql.csproj index 28e4317..fc6a417 100644 --- a/TestExamplesDotnet.PostgreSql/TestExamplesDotnet.PostgreSql.csproj +++ b/TestExamplesDotnet.PostgreSql/TestExamplesDotnet.PostgreSql.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -11,8 +11,8 @@ - - + + diff --git a/TestExamplesDotnet.sln b/TestExamplesDotnet.sln index 56bae61..d2e99fa 100644 --- a/TestExamplesDotnet.sln +++ b/TestExamplesDotnet.sln @@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt global.json = global.json README.md = README.md .gitattributes = .gitattributes + .github\workflows\build_and_test.yml = .github\workflows\build_and_test.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MsSql", "MsSql", "{BE1E949A-BD83-493B-92A1-FA456FDAED16}" diff --git a/TestExamplesDotnet/IDatabase.cs b/TestExamplesDotnet/IDatabase.cs index 9e46e14..298755a 100644 --- a/TestExamplesDotnet/IDatabase.cs +++ b/TestExamplesDotnet/IDatabase.cs @@ -6,6 +6,6 @@ public interface IDatabase { string ConnectionString { get; } - public void EnsureInitialized(IHost host); - public Task Clean(); + void EnsureInitialized(IHost host); + Task Clean(); } diff --git a/TestExamplesDotnet/TestExamplesDotnet.csproj b/TestExamplesDotnet/TestExamplesDotnet.csproj index 06150bd..cb0d224 100644 --- a/TestExamplesDotnet/TestExamplesDotnet.csproj +++ b/TestExamplesDotnet/TestExamplesDotnet.csproj @@ -1,15 +1,15 @@ - net8.0 + net9.0 enable enable latest - - + + diff --git a/build/Build.cs b/build/Build.cs index 386560e..5a67037 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -10,7 +10,6 @@ using Nuke.Common.Tools.DotNet; using Nuke.Common.Utilities.Collections; using static Nuke.Common.EnvironmentInfo; -using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.IO.PathConstruction; using static Nuke.Common.Tools.DotNet.DotNetTasks; @@ -59,15 +58,14 @@ class Build : NukeBuild Target Compile => _ => _ .DependsOn(Restore) + .After(VerifyStyle) .Executes(() => { DotNetBuild(c => c .EnableNoRestore() .SetConfiguration(Configuration) .SetProjectFile(Solution) - .SetProcessArgumentConfigurator(x => x - .Add("-warnaserror") - .Add("-warnnotaserror:CS0618,CS0612"))); + .SetProcessAdditionalArguments("-warnaserror", "-warnnotaserror:CS0618,CS0612")); }); Target Test => _ => _ diff --git a/build/_build.csproj b/build/_build.csproj index b1965fa..e1a98e3 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 .. @@ -12,7 +12,7 @@ - + diff --git a/global.json b/global.json index 780e635..ccd7812 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.100", "rollForward": "latestFeature" } }