From c5bb0505a4c26cdda05da51f74faaeee4f81281a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Wed, 14 May 2025 18:30:41 +0200 Subject: [PATCH] Update dependencies and cleanup projects * Update test projects from .NET Core 3.1 (out of support) to .NET 8 (LTS) * Remove `` (see https://github.com/Microsoft/vstest/issues/472#issuecomment-378811616) * Remove `7.2` on test projects * Fix `Run_Specifies_Cancellation_Token` which (rightfully) throws when running on .NET 8 * Fix `Run_Throws_If_Query_Is_Null` which must be async --- Octokit.GraphQL.sln.DotSettings | 1 + ...t.GraphQL.Core.Generation.UnitTests.csproj | 19 ++++----------- .../ConnectionTests.cs | 6 ++--- .../ExpressionRewriterAssertions.cs | 2 +- .../Octokit.GraphQL.Core.UnitTests.csproj | 22 +++++------------ .../Octokit.GraphQL.Core.csproj | 7 +----- .../Octokit.GraphQL.IntegrationTests.csproj | 24 +++++++------------ .../Octokit.GraphQL.UnitTests.csproj | 24 ++++--------------- src/Octokit.GraphQL/Octokit.GraphQL.csproj | 4 ---- tools/Generate/App.config | 6 ----- tools/Generate/Generate.csproj | 3 +-- 11 files changed, 31 insertions(+), 87 deletions(-) delete mode 100644 tools/Generate/App.config diff --git a/Octokit.GraphQL.sln.DotSettings b/Octokit.GraphQL.sln.DotSettings index 7acf74fb..ced2c0d7 100644 --- a/Octokit.GraphQL.sln.DotSettings +++ b/Octokit.GraphQL.sln.DotSettings @@ -5,6 +5,7 @@ True True True + True True True True diff --git a/src/Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj b/src/Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj index 26891f9e..1d41a894 100644 --- a/src/Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj +++ b/src/Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj @@ -1,24 +1,15 @@  - netcoreapp3.1 + net8.0 7.2 - - all - runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + - - - diff --git a/src/Octokit.GraphQL.Core.UnitTests/ConnectionTests.cs b/src/Octokit.GraphQL.Core.UnitTests/ConnectionTests.cs index e0ad9cb1..db1f212f 100644 --- a/src/Octokit.GraphQL.Core.UnitTests/ConnectionTests.cs +++ b/src/Octokit.GraphQL.Core.UnitTests/ConnectionTests.cs @@ -70,7 +70,7 @@ public static async Task Run_Specifies_Cancellation_Token() var connection = new Connection(ProductInformation, CredentialStore, httpClient); - await connection.Run(query, cancellationToken); + await Assert.ThrowsAsync(() => connection.Run(query, cancellationToken)); } [Theory] @@ -93,10 +93,10 @@ public static async Task Run_Specifies_Http_Headers(string name, string expected } [Fact] - public static void Run_Throws_If_Query_Is_Null() + public static async Task Run_Throws_If_Query_Is_Null() { var connection = new Connection(ProductInformation, CredentialStore); - Assert.ThrowsAsync("query", () => connection.Run(null)); + await Assert.ThrowsAsync("query", () => connection.Run(null)); } [Fact] diff --git a/src/Octokit.GraphQL.Core.UnitTests/ExpressionRewriterAssertions.cs b/src/Octokit.GraphQL.Core.UnitTests/ExpressionRewriterAssertions.cs index 1b121747..ee3a9ae8 100644 --- a/src/Octokit.GraphQL.Core.UnitTests/ExpressionRewriterAssertions.cs +++ b/src/Octokit.GraphQL.Core.UnitTests/ExpressionRewriterAssertions.cs @@ -34,7 +34,7 @@ public static void AssertExpressionQueryEqual(string expectedString, IQueryab public static void AssertCompiledQueryExpressionEqual(Expression expected, ICompiledQuery actualCompiledQuery, params string[] subqueryPlaceholderReplacements) { - var expectedString = expected.ToReadableString(); + var expectedString = expected.ToReadableString(settings => settings.NameAnonymousTypesUsing(_ => "object")); AssertCompiledQueryExpressionEqual(expectedString, actualCompiledQuery, subqueryPlaceholderReplacements); } diff --git a/src/Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj b/src/Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj index 64bb6e77..0bfabe75 100644 --- a/src/Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj +++ b/src/Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj @@ -1,25 +1,15 @@  - netcoreapp3.1 - 7.2 + net8.0 - - - all - runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + + - - - diff --git a/src/Octokit.GraphQL.Core/Octokit.GraphQL.Core.csproj b/src/Octokit.GraphQL.Core/Octokit.GraphQL.Core.csproj index aab51544..ed863640 100644 --- a/src/Octokit.GraphQL.Core/Octokit.GraphQL.Core.csproj +++ b/src/Octokit.GraphQL.Core/Octokit.GraphQL.Core.csproj @@ -5,14 +5,9 @@ true ..\..\key.snk true - bin\$(Configuration)\netstandard1.1\Octokit.GraphQL.Core.xml 7.2 - - - - - + diff --git a/src/Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj b/src/Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj index 3b2f3cf3..2cc3efef 100644 --- a/src/Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj +++ b/src/Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj @@ -1,26 +1,18 @@  - netcoreapp3.1 - Octokit.GraphQL.IntegrationTests - 7.2 + net8.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + + + + - - - diff --git a/src/Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj b/src/Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj index c276fa61..d1445710 100644 --- a/src/Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj +++ b/src/Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj @@ -1,29 +1,15 @@  - netcoreapp3.1 - 7.2 + net8.0 - - - all - runtime; build; native; contentfiles; analyzers - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + - - - - - - diff --git a/src/Octokit.GraphQL/Octokit.GraphQL.csproj b/src/Octokit.GraphQL/Octokit.GraphQL.csproj index d72d538d..db0c09c6 100644 --- a/src/Octokit.GraphQL/Octokit.GraphQL.csproj +++ b/src/Octokit.GraphQL/Octokit.GraphQL.csproj @@ -4,13 +4,9 @@ true ..\..\key.snk true - bin\$(Configuration)\netstandard1.1\Octokit.GraphQL.xml 7.2 - - - diff --git a/tools/Generate/App.config b/tools/Generate/App.config deleted file mode 100644 index 88fa4027..00000000 --- a/tools/Generate/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tools/Generate/Generate.csproj b/tools/Generate/Generate.csproj index 10ea20ff..69e043eb 100644 --- a/tools/Generate/Generate.csproj +++ b/tools/Generate/Generate.csproj @@ -1,8 +1,7 @@  Exe - netcoreapp3.1 - 7.2 + net8.0