diff --git a/Directory.Packages.props b/Directory.Packages.props
index d3e799a82..6a19f850b 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,10 +4,10 @@
- 2.35.0
+ 2.57.0
2.46.6
- 1.9.7
- 2.2.85
+ 1.9.16
+ 2.5.129
4.3.1
3.9.0
@@ -20,7 +20,6 @@
-
@@ -33,6 +32,7 @@
+
diff --git a/samples/ChatApp/.config/dotnet-tools.json b/samples/ChatApp/.config/dotnet-tools.json
index d7852f42f..5497a4c24 100644
--- a/samples/ChatApp/.config/dotnet-tools.json
+++ b/samples/ChatApp/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"messagepack.generator": {
- "version": "2.4.35",
+ "version": "2.5.129",
"commands": [
"mpc"
]
diff --git a/samples/ChatApp/Nuget.config b/samples/ChatApp/Nuget.config
deleted file mode 100644
index e05d8fc6f..000000000
--- a/samples/ChatApp/Nuget.config
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/MagicOnion.Server/StreamingContext.Duplex.cs b/src/MagicOnion.Server/StreamingContext.Duplex.cs
index 501735ca7..b73571751 100644
--- a/src/MagicOnion.Server/StreamingContext.Duplex.cs
+++ b/src/MagicOnion.Server/StreamingContext.Duplex.cs
@@ -24,7 +24,7 @@ internal DuplexStreamingContext(StreamingServiceContext con
///
/// IServerStreamWriter Methods.
///
- public WriteOptions WriteOptions
+ public WriteOptions? WriteOptions
{
get => innerWriter.WriteOptions;
set => innerWriter.WriteOptions = value;
diff --git a/src/MagicOnion.Server/StreamingContext.Server.cs b/src/MagicOnion.Server/StreamingContext.Server.cs
index 1b5c181df..a77adabd6 100644
--- a/src/MagicOnion.Server/StreamingContext.Server.cs
+++ b/src/MagicOnion.Server/StreamingContext.Server.cs
@@ -20,7 +20,7 @@ internal ServerStreamingContext(StreamingServiceContext context;
- public WriteOptions WriteOptions
+ public WriteOptions? WriteOptions
{
get => inner.WriteOptions;
set => inner.WriteOptions = value;
diff --git a/tests/MagicOnion.Client.Tests/ClientFilterTest.cs b/tests/MagicOnion.Client.Tests/ClientFilterTest.cs
index 164747eb9..517075445 100644
--- a/tests/MagicOnion.Client.Tests/ClientFilterTest.cs
+++ b/tests/MagicOnion.Client.Tests/ClientFilterTest.cs
@@ -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.Create("Response", Status.DefaultSuccess, Metadata.Empty, Metadata.Empty)));
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default!)
.Returns(new AsyncUnaryCall(
Task.FromResult("Response"),
Task.FromResult(Metadata.Empty),
@@ -40,7 +40,7 @@ public async Task RequestHeaders()
// Arrange
var requestHeaders = default(Metadata);
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
requestHeaders = x.Arg().Headers;
@@ -70,8 +70,8 @@ class ClientFilterTestRequestHeaders : IClientFilter
{
public ValueTask SendAsync(RequestContext context, Func> 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);
}
}
@@ -102,7 +102,7 @@ public async Task FilterChain()
});
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method)!, default, default, default!)
.ReturnsForAnyArgs(new AsyncUnaryCall(
Task.FromResult("Response"),
Task.FromResult(Metadata.Empty),
diff --git a/tests/MagicOnion.Client.Tests/ClientStreamingTest.cs b/tests/MagicOnion.Client.Tests/ClientStreamingTest.cs
index 42483b4f0..a6a41eea9 100644
--- a/tests/MagicOnion.Client.Tests/ClientStreamingTest.cs
+++ b/tests/MagicOnion.Client.Tests/ClientStreamingTest.cs
@@ -32,7 +32,7 @@ public async Task WriteAndCompleteArgumentValueTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default));
+ new object()));
var client = MagicOnionClient.Create(callInvokerMock);
// Act
@@ -64,7 +64,7 @@ public async Task WriteAndCompleteArgumentRefTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default));
+ new object()));
var client = MagicOnionClient.Create(callInvokerMock);
@@ -89,7 +89,7 @@ public async Task WriteAndCompleteArgumentValueTypeReturnRefType()
var clientStreamWriterMock = new MockClientStreamWriter>();
var callInvokerMock = Substitute.For();
var response = "OK";
- callInvokerMock.AsyncClientStreamingCall(default(Method, string>), default, default)
+ callInvokerMock.AsyncClientStreamingCall(default(Method, string>)!, default, default)
.ReturnsForAnyArgs(new AsyncClientStreamingCall, string>(
clientStreamWriterMock,
Task.FromResult(response),
@@ -97,7 +97,7 @@ public async Task WriteAndCompleteArgumentValueTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default));
+ new object()));
var client = MagicOnionClient.Create(callInvokerMock);
// Act
@@ -121,7 +121,7 @@ public async Task WriteAndCompleteArgumentRefTypeReturnRefType()
var clientStreamWriterMock = new MockClientStreamWriter>();
var callInvokerMock = Substitute.For();
var response = "OK";
- callInvokerMock.AsyncClientStreamingCall(default(Method, string>), default, default)
+ callInvokerMock.AsyncClientStreamingCall(default(Method, string>)!, default, default)
.ReturnsForAnyArgs(new AsyncClientStreamingCall, string>(
clientStreamWriterMock,
Task.FromResult(response),
@@ -129,7 +129,7 @@ public async Task WriteAndCompleteArgumentRefTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default));
+ new object()));
var client = MagicOnionClient.Create(callInvokerMock);
// Act
diff --git a/tests/MagicOnion.Client.Tests/MockClientStreamWriter.cs b/tests/MagicOnion.Client.Tests/MockClientStreamWriter.cs
index e9d53fe46..3ca100ef9 100644
--- a/tests/MagicOnion.Client.Tests/MockClientStreamWriter.cs
+++ b/tests/MagicOnion.Client.Tests/MockClientStreamWriter.cs
@@ -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;
}
-}
\ No newline at end of file
+}
diff --git a/tests/MagicOnion.Client.Tests/ServerStreamingTest.cs b/tests/MagicOnion.Client.Tests/ServerStreamingTest.cs
index 7ca935379..35f5e3d2c 100644
--- a/tests/MagicOnion.Client.Tests/ServerStreamingTest.cs
+++ b/tests/MagicOnion.Client.Tests/ServerStreamingTest.cs
@@ -25,7 +25,7 @@ public async Task OneParameterValueTypeReturnValueType()
var callInvokerMock = Substitute.For();
var arg1 = 123;
var sendRequest = default(Box);
- callInvokerMock.AsyncServerStreamingCall(default(Method, Box>)!, default, default, default)
+ callInvokerMock.AsyncServerStreamingCall(default(Method, Box>)!, default, default, Box.Create(default(int)))
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt>(3);
@@ -36,7 +36,7 @@ public async Task OneParameterValueTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default);
+ new object());
});
var client = MagicOnionClient.Create(callInvokerMock);
@@ -67,7 +67,7 @@ public async Task OneParameterRefTypeReturnValueType()
var callInvokerMock = Substitute.For();
var arg1 = "FooBar";
var sendRequest = default(string);
- callInvokerMock.AsyncServerStreamingCall(default(Method>)!, default, default, default)
+ callInvokerMock.AsyncServerStreamingCall(default(Method>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt(3);
@@ -78,7 +78,7 @@ public async Task OneParameterRefTypeReturnValueType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default);
+ new object());
});
var client = MagicOnionClient.Create(callInvokerMock);
@@ -109,7 +109,7 @@ public async Task OneParameterValueTypeReturnRefType()
var callInvokerMock = Substitute.For();
var arg1 = 123;
var sendRequest = default(Box);
- callInvokerMock.AsyncServerStreamingCall(default(Method, string>)!, default, default, default)
+ callInvokerMock.AsyncServerStreamingCall(default(Method, string>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt>(3);
@@ -120,7 +120,7 @@ public async Task OneParameterValueTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default);
+ new object());
});
var client = MagicOnionClient.Create(callInvokerMock);
@@ -151,7 +151,7 @@ public async Task OneParameterRefTypeReturnRefType()
var callInvokerMock = Substitute.For();
var arg1 = "FooBar";
var sendRequest = default(string);
- callInvokerMock.AsyncServerStreamingCall(default(Method)!, default, default, default)
+ callInvokerMock.AsyncServerStreamingCall(default(Method)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
var request = x.ArgAt(3);
@@ -162,7 +162,7 @@ public async Task OneParameterRefTypeReturnRefType()
_ => Status.DefaultSuccess,
_ => Metadata.Empty,
_ => { },
- default);
+ new object());
});
var client = MagicOnionClient.Create(callInvokerMock);
diff --git a/tests/MagicOnion.Client.Tests/UnaryTest.cs b/tests/MagicOnion.Client.Tests/UnaryTest.cs
index 5a6c75286..68fcf514a 100644
--- a/tests/MagicOnion.Client.Tests/UnaryTest.cs
+++ b/tests/MagicOnion.Client.Tests/UnaryTest.cs
@@ -25,7 +25,7 @@ public async Task Clone_WithOptions()
// Arrange
var actualCallOptions = default(CallOptions);
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
@@ -70,7 +70,7 @@ public async Task Clone_WithCancellationToken()
var cts = new CancellationTokenSource();
var actualCancellationToken = default(CancellationToken);
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
@@ -96,7 +96,7 @@ public async Task Clone_WithHeaders()
// Arrange
var actualHeaders = default(Metadata);
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
@@ -122,7 +122,7 @@ public async Task ParameterlessRequestsNil()
// Arrange
var serializedResponse = new ReadOnlyMemory();
var callInvokerMock = Substitute.For();
- callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default)
+ callInvokerMock.AsyncUnaryCall(default(Method, Box>)!, default, default, default!)
.ReturnsForAnyArgs(x =>
{
// method, host, callOptions, request
diff --git a/tests/MagicOnion.Integration.Tests/ClientFilterTest.cs b/tests/MagicOnion.Integration.Tests/ClientFilterTest.cs
index 6df9e70a7..5bcc651f9 100644
--- a/tests/MagicOnion.Integration.Tests/ClientFilterTest.cs
+++ b/tests/MagicOnion.Integration.Tests/ClientFilterTest.cs
@@ -138,8 +138,8 @@ public class AppendHeaderFilter : IClientFilter
public async ValueTask SendAsync(RequestContext context, Func> 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;