Skip to content

Commit

Permalink
Upgrade dependencies (#603)
Browse files Browse the repository at this point in the history
* upgrade dependencies

* fix code warnings
  • Loading branch information
rose-a authored Nov 23, 2023
1 parent cfac737 commit fbf37df
Show file tree
Hide file tree
Showing 19 changed files with 74 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.4.1" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.6.1" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Text.Json" Version="4.7.0" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOp
DefaultBufferSize = options.DefaultBufferSize,
DictionaryKeyPolicy = options.DictionaryKeyPolicy,
Encoder = options.Encoder,
#pragma warning disable SYSLIB0020
// obsolete warning disabled to keep compatibility until deprecated field is removed
IgnoreNullValues = options.IgnoreNullValues,
#pragma warning restore SYSLIB0020
IgnoreReadOnlyProperties = options.IgnoreReadOnlyProperties,
MaxDepth = options.MaxDepth,
PropertyNameCaseInsensitive = options.PropertyNameCaseInsensitive,
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL.Client/GraphQL.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
Expand Down
3 changes: 2 additions & 1 deletion tests/GraphQL.Client.Serializer.Tests/BaseSerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ public async Task CanDeserializeObjectWithBothConstructorAndProperties()
var contentStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(jsonString));

// Act
var result = await ClientSerializer.DeserializeFromUtf8StreamAsync<WithConstructorAndProperties>(contentStream, default).ConfigureAwait(false);
var result = await ClientSerializer
.DeserializeFromUtf8StreamAsync<WithConstructorAndProperties>(contentStream, default);

// Assert
result.Data.Property1.Should().Be("value1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.4.1" />
<PackageReference Include="GraphQL.SystemTextJson" Version="7.4.1" />
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.6.1" />
<PackageReference Include="GraphQL.SystemTextJson" Version="7.6.1" />
</ItemGroup>

<ItemGroup>
Expand All @@ -19,4 +19,13 @@
<ProjectReference Include="..\GraphQL.Client.Tests.Common\GraphQL.Client.Tests.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<ItemGroup>
<PackageReference Include="FluentAssertions.Reactive" Version="0.2.0" />
<PackageReference Include="GraphQL" Version="7.4.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="GraphQL" Version="7.6.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 11 additions & 2 deletions tests/GraphQL.Integration.Tests/GraphQL.Integration.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.5" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -18,4 +18,13 @@
<ProjectReference Include="..\IntegrationTestServer\IntegrationTestServer.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using System.Net.Http.Headers;
using FluentAssertions;
using GraphQL.Client.Abstractions;
using GraphQL.Client.Http;
Expand Down Expand Up @@ -185,7 +184,7 @@ query Long {
// unblock the query
chatQuery.LongRunningQueryBlocker.Set();
// check execution time
request.Invoke().Result.Data.longRunning.Should().Be("finally returned");
(await request.Invoke()).Data.longRunning.Should().Be("finally returned");

// reset stuff
chatQuery.LongRunningQueryBlocker.Reset();
Expand Down
4 changes: 2 additions & 2 deletions tests/GraphQL.Integration.Tests/UriExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public void HasWebSocketSchemaTest(string url, bool result)
[InlineData("ftp://this-url-cannot-be-converted.net", false, null)]
// AppSync example
[InlineData("wss://example1234567890000.appsync-realtime-api.us-west-2.amazonaws.com/graphql?header=123456789ABCDEF&payload=e30=", true, "wss://example1234567890000.appsync-realtime-api.us-west-2.amazonaws.com/graphql?header=123456789ABCDEF&payload=e30=")]
public void GetWebSocketUriTest(string input, bool canConvert, string result)
public void GetWebSocketUriTest(string input, bool canConvert, string? result)
{
var inputUri = new Uri(input);
if (canConvert)
{
inputUri.GetWebSocketUri().Should().BeEquivalentTo(new Uri(result));
inputUri.GetWebSocketUri().Should().BeEquivalentTo(new Uri(result!));
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions tests/GraphQL.Integration.Tests/UserAgentHeaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public UserAgentHeaderTests(SystemTextJsonAutoNegotiateServerTestFixture fixture
Fixture = fixture;
}

public async Task InitializeAsync() => await Fixture.CreateServer().ConfigureAwait(false);
public async Task InitializeAsync() => await Fixture.CreateServer();

public Task DisposeAsync()
{
Expand All @@ -32,7 +32,7 @@ public async void Can_set_custom_user_agent()
ChatClient = Fixture.GetChatClient(options => options.DefaultUserAgentRequestHeader = ProductInfoHeaderValue.Parse(userAgent));

var graphQLRequest = new GraphQLRequest("query clientUserAgent { clientUserAgent }");
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty }).ConfigureAwait(false);
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty });

response.Errors.Should().BeNull();
response.Data.clientUserAgent.Should().Be(userAgent);
Expand All @@ -48,7 +48,7 @@ public async void Default_user_agent_is_set_as_expected()
ChatClient = Fixture.GetChatClient();

var graphQLRequest = new GraphQLRequest("query clientUserAgent { clientUserAgent }");
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty }).ConfigureAwait(false);
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty });

response.Errors.Should().BeNull();
response.Data.clientUserAgent.Should().Be(expectedUserAgent);
Expand All @@ -60,7 +60,7 @@ public async void No_Default_user_agent_if_set_to_null()
ChatClient = Fixture.GetChatClient(options => options.DefaultUserAgentRequestHeader = null);

var graphQLRequest = new GraphQLRequest("query clientUserAgent { clientUserAgent }");
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty }).ConfigureAwait(false);
var response = await ChatClient.SendQueryAsync(graphQLRequest, () => new { clientUserAgent = string.Empty });

response.Errors.Should().HaveCount(1);
response.Errors[0].Message.Should().Be("user agent header not set");
Expand Down
2 changes: 1 addition & 1 deletion tests/GraphQL.Integration.Tests/WebsocketTests/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ query Long {
// unblock the query
chatQuery.LongRunningQueryBlocker.Set();
// check execution time
request.Invoke().Result.Data.longRunning.Should().Be("finally returned");
(await request.Invoke()).Data.longRunning.Should().Be("finally returned");

// reset stuff
chatQuery.LongRunningQueryBlocker.Reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public SystemTextJsonAutoNegotiate(ITestOutputHelper output, SystemTextJsonAutoN
[Fact]
public async Task WebSocketProtocolIsAutoNegotiated()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();
ChatClient.WebSocketSubProtocol.Should().Be(WebSocketProtocols.GRAPHQL_TRANSPORT_WS);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ public SystemTextJsonGraphQLTransportWs(ITestOutputHelper output, SystemTextJson
[Fact]
public async void Sending_a_pong_message_should_not_throw()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();

await ChatClient.Awaiting(client => client.SendPongAsync(null)).Should().NotThrowAsync().ConfigureAwait(false);
await ChatClient.Awaiting(client => client.SendPongAsync("some payload")).Should().NotThrowAsync().ConfigureAwait(false);
await ChatClient.Awaiting(client => client.SendPongAsync(null)).Should().NotThrowAsync();
await ChatClient.Awaiting(client => client.SendPongAsync("some payload")).Should().NotThrowAsync();
}

[Fact]
public async void Sending_a_ping_message_should_result_in_a_pong_message_from_the_server()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();

using var pongObserver = ChatClient.PongStream.Observe();

await ChatClient.Awaiting(client => client.SendPingAsync(null)).Should().NotThrowAsync().ConfigureAwait(false);
await ChatClient.Awaiting(client => client.SendPingAsync(null)).Should().NotThrowAsync();

await pongObserver.Should().PushAsync(1, TimeSpan.FromSeconds(1), "because the server was pinged by the client").ConfigureAwait(false);
await pongObserver.Should().PushAsync(1, TimeSpan.FromSeconds(1), "because the server was pinged by the client");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ public SystemTextJsonGraphQLWs(ITestOutputHelper output, SystemTextJsonGraphQLWs
[Fact]
public async void Sending_a_ping_message_should_throw_not_supported_exception()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();

await ChatClient.Awaiting(client => client.SendPingAsync(null))
.Should().ThrowAsync<NotSupportedException>().ConfigureAwait(false);
.Should().ThrowAsync<NotSupportedException>();
}

[Fact]
public async void Sending_a_pong_message_should_throw_not_supported_exception()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();

await ChatClient.Awaiting(client => client.SendPongAsync(null))
.Should().ThrowAsync<NotSupportedException>().ConfigureAwait(false);
.Should().ThrowAsync<NotSupportedException>();
}

[Fact]
public async void Subscribing_to_the_pong_stream_should_throw_not_supported_exception()
{
await ChatClient.InitializeWebsocketConnection().ConfigureAwait(false);
await ChatClient.InitializeWebsocketConnection();

ChatClient.Invoking(client => client.PongStream.Subscribe())
.Should().Throw<NotSupportedException>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@
<ProjectReference Include="..\..\src\GraphQL.Primitives\GraphQL.Primitives.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
11 changes: 6 additions & 5 deletions tests/GraphQL.Primitives.Tests/GraphQLRequestTest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using FluentAssertions;
using Xunit;

namespace GraphQL.Primitives.Tests;
Expand Down Expand Up @@ -26,23 +27,23 @@ public void ConstructorExtendedFact()
public void Equality1Fact()
{
var graphQLRequest = new GraphQLRequest("{hero{name}}");
Assert.Equal(graphQLRequest, graphQLRequest);
graphQLRequest.Equals(graphQLRequest).Should().BeTrue();
}

[Fact]
public void Equality2Fact()
{
var graphQLRequest1 = new GraphQLRequest("{hero{name}}");
var graphQLRequest2 = new GraphQLRequest("{hero{name}}");
Assert.Equal(graphQLRequest1, graphQLRequest2);
graphQLRequest1.Equals(graphQLRequest2).Should().BeTrue();
}

[Fact]
public void Equality3Fact()
{
var graphQLRequest1 = new GraphQLRequest("{hero{name}}", new { varName = "varValue" }, "operationName");
var graphQLRequest2 = new GraphQLRequest("{hero{name}}", new { varName = "varValue" }, "operationName");
Assert.Equal(graphQLRequest1, graphQLRequest2);
graphQLRequest1.Equals(graphQLRequest2).Should().BeTrue();
}

[Fact]
Expand All @@ -66,15 +67,15 @@ public void InEquality1Fact()
{
var graphQLRequest1 = new GraphQLRequest("{hero{name1}}");
var graphQLRequest2 = new GraphQLRequest("{hero{name2}}");
Assert.NotEqual(graphQLRequest1, graphQLRequest2);
graphQLRequest1.Equals(graphQLRequest2).Should().BeFalse();
}

[Fact]
public void InEquality2Fact()
{
var graphQLRequest1 = new GraphQLRequest("{hero{name}}", new { varName = "varValue1" }, "operationName");
var graphQLRequest2 = new GraphQLRequest("{hero{name}}", new { varName = "varValue2" }, "operationName");
Assert.NotEqual(graphQLRequest1, graphQLRequest2);
graphQLRequest1.Equals(graphQLRequest2).Should().BeFalse();
}

[Fact]
Expand Down
6 changes: 3 additions & 3 deletions tests/GraphQL.Server.Test/GraphQL.Server.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.4.1" />
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.4.0" />
<PackageReference Include="GraphQL.Server.Ui.GraphiQL" Version="7.4.0" />
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.6.1" />
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.6.0" />
<PackageReference Include="GraphQL.Server.Ui.GraphiQL" Version="7.6.0" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions tests/IntegrationTestServer/IntegrationTestServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GraphQL.Server.All" Version="7.4.0" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="System.Reactive.Compatibility" Version="5.0.0" />
<PackageReference Include="GraphQL.Server.All" Version="7.6.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive.Compatibility" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit fbf37df

Please sign in to comment.