From dc9735cb80599a77e16bb5d340b4316fb20b834c Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Wed, 24 Nov 2021 12:10:43 +0900 Subject: [PATCH] Fix warnings --- src/MagicOnion.Server/MagicOnionEngine.cs | 2 +- .../Tests/StreamingHubTest.cs | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/MagicOnion.Server/MagicOnionEngine.cs b/src/MagicOnion.Server/MagicOnionEngine.cs index 2f5c20219..0af5e71fb 100644 --- a/src/MagicOnion.Server/MagicOnionEngine.cs +++ b/src/MagicOnion.Server/MagicOnionEngine.cs @@ -201,7 +201,7 @@ public static MagicOnionServiceDefinition BuildServerServiceDefinition(IServiceP } streamingHubHandlers.AddRange(tempStreamingHubHandlers!); - StreamingHubHandlerRepository.RegisterHandler(connectHandler, tempStreamingHubHandlers.ToArray()); + StreamingHubHandlerRepository.RegisterHandler(connectHandler, tempStreamingHubHandlers!.ToArray()); IGroupRepositoryFactory factory; var attr = classType.GetCustomAttribute(true); if (attr != null) diff --git a/tests/MagicOnion.Server.Tests/Tests/StreamingHubTest.cs b/tests/MagicOnion.Server.Tests/Tests/StreamingHubTest.cs index 76a6eaa24..ce22ead37 100644 --- a/tests/MagicOnion.Server.Tests/Tests/StreamingHubTest.cs +++ b/tests/MagicOnion.Server.Tests/Tests/StreamingHubTest.cs @@ -148,7 +148,7 @@ public async Task ZeroArgument() { try { - client = StreamingHubClient.Connect(channel, this); + client = await StreamingHubClient.ConnectAsync(channel, this); await client.ZeroArgument(); await voidZeroTask.Task; //await zeroTask.Task; @@ -167,7 +167,7 @@ public async Task ZeroArgument() [Fact] public async Task OneArgument() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); await client.OneArgument(100); //var x = await oneTask.Task; var y = await voidoneTask.Task; @@ -179,7 +179,7 @@ public async Task OneArgument() [Fact] public async Task MoreArgument() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); await client.MoreArgument(100, "foo", 10.3); //var x = await moreTask.Task; var y = await voidmoreTask.Task; @@ -191,7 +191,7 @@ public async Task MoreArgument() [Fact] public async Task RetrunZeroArgument() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); var v = await client.RetrunZeroArgument(); v.Should().Be(1000); await client.DisposeAsync(); @@ -199,7 +199,7 @@ public async Task RetrunZeroArgument() [Fact] public async Task RetrunOneArgument() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); var v = await client.RetrunZeroArgument(); v.Should().Be(1000); await client.DisposeAsync(); @@ -207,7 +207,7 @@ public async Task RetrunOneArgument() [Fact] public async Task RetrunMoreArgument() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); var v = await client.RetrunMoreArgument(10, "foo", 30.4); v.Should().Be(30.4); await client.DisposeAsync(); @@ -216,7 +216,7 @@ public async Task RetrunMoreArgument() [Fact] public async Task OneArgument2() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); await client.OneArgument2(new TestObject() { X = 10, Y = 99, Z = 100 }); { //var v = await one2Task.Task; @@ -235,7 +235,7 @@ public async Task OneArgument2() [Fact] public async Task RetrunOneArgument2() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); var v = await client.RetrunOneArgument2(new TestObject() { X = 10, Y = 99, Z = 100 }); v.X.Should().Be(10); v.Y.Should().Be(99); @@ -246,7 +246,7 @@ public async Task RetrunOneArgument2() [Fact] public async Task OneArgument3() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); await client.OneArgument3(new[] { new TestObject() { X = 10, Y = 99, Z = 100 }, @@ -288,7 +288,7 @@ await client.OneArgument3(new[] [Fact] public async Task RetrunOneArgument3() { - var client = StreamingHubClient.Connect(channel, this); + var client = await StreamingHubClient.ConnectAsync(channel, this); var v = await client.RetrunOneArgument3(new[] { new TestObject() { X = 10, Y = 99, Z = 100 }, @@ -440,7 +440,7 @@ public MoreCheckHubTest(ITestOutputHelper logger, ServerFixture se [Fact] public async Task ReceiveEx() { - client = StreamingHubClient.Connect(channel, this); + client = await StreamingHubClient.ConnectAsync(channel, this); var ex = Assert.Throws(() => { @@ -456,7 +456,7 @@ public async Task ReceiveEx() [Fact] public async Task StatusCodeEx() { - client = StreamingHubClient.Connect(channel, this); + client = await StreamingHubClient.ConnectAsync(channel, this); var ex = Assert.Throws(() => { @@ -473,7 +473,7 @@ public async Task StatusCodeEx() [Fact] public async Task Filter() { - client = StreamingHubClient.Connect(channel, this); + client = await StreamingHubClient.ConnectAsync(channel, this); await client.FilterCheckAsync(); }