Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #697

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</PropertyGroup>

<PropertyGroup>
<GrpcVersion>2.35.0</GrpcVersion>
<GrpcVersion>2.57.0</GrpcVersion>
<GrpcCCoreVersion>2.46.6</GrpcCCoreVersion>
<MemoryPackVersion>1.9.7</MemoryPackVersion>
<MessagePackVersion>2.2.85</MessagePackVersion>
<MemoryPackVersion>1.9.16</MemoryPackVersion>
<MessagePackVersion>2.5.129</MessagePackVersion>
<MicrosoftCodeAnalysisVersion>4.3.1</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersionUnity>3.9.0</MicrosoftCodeAnalysisVersionUnity>
</PropertyGroup>
Expand All @@ -20,7 +20,6 @@
<PackageVersion Include="Grpc.Net.Client" Version="$(GrpcVersion)" />
<PackageVersion Include="MemoryPack" Version="$(MemoryPackVersion)" />
<PackageVersion Include="MessagePack" Version="$(MessagePackVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
Expand All @@ -33,6 +32,7 @@
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
<!-- from https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.2-beta1.23163.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
Expand Down
2 changes: 1 addition & 1 deletion samples/ChatApp/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"messagepack.generator": {
"version": "2.4.35",
"version": "2.5.129",
"commands": [
"mpc"
]
Expand Down
13 changes: 0 additions & 13 deletions samples/ChatApp/Nuget.config

This file was deleted.

2 changes: 1 addition & 1 deletion src/MagicOnion.Server/StreamingContext.Duplex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal DuplexStreamingContext(StreamingServiceContext<TRequest, TResponse> con
/// <summary>
/// IServerStreamWriter Methods.
/// </summary>
public WriteOptions WriteOptions
public WriteOptions? WriteOptions
{
get => innerWriter.WriteOptions;
set => innerWriter.WriteOptions = value;
Expand Down
2 changes: 1 addition & 1 deletion src/MagicOnion.Server/StreamingContext.Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal ServerStreamingContext(StreamingServiceContext<Nil /* Dummy */, TRespon

public ServiceContext ServiceContext => context;

public WriteOptions WriteOptions
public WriteOptions? WriteOptions
{
get => inner.WriteOptions;
set => inner.WriteOptions = value;
Expand Down
10 changes: 5 additions & 5 deletions tests/MagicOnion.Client.Tests/ClientFilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public async Task ReturnImmediateValue()
// NOTE: Mock IClientFilter returns a value immediately. (The filter will not call `next`)
.ReturnsForAnyArgs(ValueTask.FromResult((ResponseContext)ResponseContext<string>.Create("Response", Status.DefaultSuccess, Metadata.Empty, Metadata.Empty)));
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default!)
.Returns(new AsyncUnaryCall<string>(
Task.FromResult("Response"),
Task.FromResult(Metadata.Empty),
Expand Down Expand Up @@ -40,7 +40,7 @@ public async Task RequestHeaders()
// Arrange
var requestHeaders = default(Metadata);
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
requestHeaders = x.Arg<CallOptions>().Headers;
Expand Down Expand Up @@ -70,8 +70,8 @@ class ClientFilterTestRequestHeaders : IClientFilter
{
public ValueTask<ResponseContext> SendAsync(RequestContext context, Func<RequestContext, ValueTask<ResponseContext>> next)
{
context.CallOptions.Headers.Add("x-header-1", "valueA");
context.CallOptions.Headers.Add("x-header-2", "valueB");
context.CallOptions.Headers?.Add("x-header-1", "valueA");
context.CallOptions.Headers?.Add("x-header-2", "valueB");
return next(context);
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@ public async Task FilterChain()
});

var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<string, string>)!, default, default, default!)
.ReturnsForAnyArgs(new AsyncUnaryCall<string>(
Task.FromResult("Response"),
Task.FromResult(Metadata.Empty),
Expand Down
12 changes: 6 additions & 6 deletions tests/MagicOnion.Client.Tests/ClientStreamingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task WriteAndCompleteArgumentValueTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default));
new object()));
var client = MagicOnionClient.Create<IClientStreamingTestService>(callInvokerMock);

// Act
Expand Down Expand Up @@ -64,7 +64,7 @@ public async Task WriteAndCompleteArgumentRefTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default));
new object()));

var client = MagicOnionClient.Create<IClientStreamingTestService>(callInvokerMock);

Expand All @@ -89,15 +89,15 @@ public async Task WriteAndCompleteArgumentValueTypeReturnRefType()
var clientStreamWriterMock = new MockClientStreamWriter<Box<int>>();
var callInvokerMock = Substitute.For<CallInvoker>();
var response = "OK";
callInvokerMock.AsyncClientStreamingCall(default(Method<Box<int>, string>), default, default)
callInvokerMock.AsyncClientStreamingCall(default(Method<Box<int>, string>)!, default, default)
.ReturnsForAnyArgs(new AsyncClientStreamingCall<Box<int>, string>(
clientStreamWriterMock,
Task.FromResult(response),
_ => Task.FromResult(Metadata.Empty),
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default));
new object()));
var client = MagicOnionClient.Create<IClientStreamingTestService>(callInvokerMock);

// Act
Expand All @@ -121,15 +121,15 @@ public async Task WriteAndCompleteArgumentRefTypeReturnRefType()
var clientStreamWriterMock = new MockClientStreamWriter<Tuple<string, string>>();
var callInvokerMock = Substitute.For<CallInvoker>();
var response = "OK";
callInvokerMock.AsyncClientStreamingCall(default(Method<Tuple<string, string>, string>), default, default)
callInvokerMock.AsyncClientStreamingCall(default(Method<Tuple<string, string>, string>)!, default, default)
.ReturnsForAnyArgs(new AsyncClientStreamingCall<Tuple<string, string>, string>(
clientStreamWriterMock,
Task.FromResult(response),
_ => Task.FromResult(Metadata.Empty),
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default));
new object()));
var client = MagicOnionClient.Create<IClientStreamingTestService>(callInvokerMock);

// Act
Expand Down
4 changes: 2 additions & 2 deletions tests/MagicOnion.Client.Tests/MockClientStreamWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public Task WriteAsync(T message)
return Task.CompletedTask;
}

public WriteOptions WriteOptions { get; set; } = WriteOptions.Default;
public WriteOptions? WriteOptions { get; set; } = WriteOptions.Default;

public Task CompleteAsync()
{
Completed = true;
return Task.CompletedTask;
}
}
}
16 changes: 8 additions & 8 deletions tests/MagicOnion.Client.Tests/ServerStreamingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task OneParameterValueTypeReturnValueType()
var callInvokerMock = Substitute.For<CallInvoker>();
var arg1 = 123;
var sendRequest = default(Box<int>);
callInvokerMock.AsyncServerStreamingCall(default(Method<Box<int>, Box<int>>)!, default, default, default)
callInvokerMock.AsyncServerStreamingCall(default(Method<Box<int>, Box<int>>)!, default, default, Box.Create(default(int)))
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt<Box<int>>(3);
Expand All @@ -36,7 +36,7 @@ public async Task OneParameterValueTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default);
new object());
});
var client = MagicOnionClient.Create<IServerStreamingTestService>(callInvokerMock);

Expand Down Expand Up @@ -67,7 +67,7 @@ public async Task OneParameterRefTypeReturnValueType()
var callInvokerMock = Substitute.For<CallInvoker>();
var arg1 = "FooBar";
var sendRequest = default(string);
callInvokerMock.AsyncServerStreamingCall(default(Method<string, Box<int>>)!, default, default, default)
callInvokerMock.AsyncServerStreamingCall(default(Method<string, Box<int>>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt<string>(3);
Expand All @@ -78,7 +78,7 @@ public async Task OneParameterRefTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default);
new object());
});
var client = MagicOnionClient.Create<IServerStreamingTestService>(callInvokerMock);

Expand Down Expand Up @@ -109,7 +109,7 @@ public async Task OneParameterValueTypeReturnRefType()
var callInvokerMock = Substitute.For<CallInvoker>();
var arg1 = 123;
var sendRequest = default(Box<int>);
callInvokerMock.AsyncServerStreamingCall(default(Method<Box<int>, string>)!, default, default, default)
callInvokerMock.AsyncServerStreamingCall(default(Method<Box<int>, string>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt<Box<int>>(3);
Expand All @@ -120,7 +120,7 @@ public async Task OneParameterValueTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default);
new object());
});
var client = MagicOnionClient.Create<IServerStreamingTestService>(callInvokerMock);

Expand Down Expand Up @@ -151,7 +151,7 @@ public async Task OneParameterRefTypeReturnRefType()
var callInvokerMock = Substitute.For<CallInvoker>();
var arg1 = "FooBar";
var sendRequest = default(string);
callInvokerMock.AsyncServerStreamingCall(default(Method<string, string>)!, default, default, default)
callInvokerMock.AsyncServerStreamingCall(default(Method<string, string>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt<string>(3);
Expand All @@ -162,7 +162,7 @@ public async Task OneParameterRefTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
default);
new object());
});
var client = MagicOnionClient.Create<IServerStreamingTestService>(callInvokerMock);

Expand Down
8 changes: 4 additions & 4 deletions tests/MagicOnion.Client.Tests/UnaryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task Clone_WithOptions()
// Arrange
var actualCallOptions = default(CallOptions);
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
Expand Down Expand Up @@ -70,7 +70,7 @@ public async Task Clone_WithCancellationToken()
var cts = new CancellationTokenSource();
var actualCancellationToken = default(CancellationToken);
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
Expand All @@ -96,7 +96,7 @@ public async Task Clone_WithHeaders()
// Arrange
var actualHeaders = default(Metadata);
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
Expand All @@ -122,7 +122,7 @@ public async Task ParameterlessRequestsNil()
// Arrange
var serializedResponse = new ReadOnlyMemory<byte>();
var callInvokerMock = Substitute.For<CallInvoker>();
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default)
callInvokerMock.AsyncUnaryCall(default(Method<Box<Nil>, Box<Nil>>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
Expand Down
4 changes: 2 additions & 2 deletions tests/MagicOnion.Integration.Tests/ClientFilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public class AppendHeaderFilter : IClientFilter
public async ValueTask<ResponseContext> SendAsync(RequestContext context, Func<RequestContext, ValueTask<ResponseContext>> next)
{
var header = context.CallOptions.Headers;
header.Add("x-foo", "abcdefg");
header.Add("x-bar", "hijklmn");
header?.Add("x-foo", "abcdefg");
header?.Add("x-bar", "hijklmn");

var response = await next(context);
return response;
Expand Down
Loading