From b8c77c59c56731f9fdffc9bc9511a9da44cd3d68 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 9 Aug 2017 09:05:54 +0200 Subject: Fix warnings in Grpc.Examples --- src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj | 1 + src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj | 1 + src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj | 1 + src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs | 6 +++--- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 1 + src/csharp/Grpc.Examples/MathServiceImpl.cs | 3 ++- src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj | 1 + src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs | 4 ++-- src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj | 1 + src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj | 1 + src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs | 4 ++-- 11 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj index 08df026a53..74deed6584 100755 --- a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj +++ b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj @@ -9,6 +9,7 @@ Exe Grpc.Examples.MathClient 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj index a02937474a..1abf261498 100755 --- a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj +++ b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj @@ -9,6 +9,7 @@ Exe Grpc.Examples.MathServer 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 9a8e62cc8b..d2a13ed6e1 100755 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -10,6 +10,7 @@ Grpc.Examples.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 8e6d685e0f..ded80ffba5 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -37,7 +37,7 @@ namespace Math.Tests Channel channel; Math.MathClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 @@ -51,7 +51,7 @@ namespace Math.Tests client = new Math.MathClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); @@ -130,7 +130,7 @@ namespace Math.Tests } [Test] - public async Task FibWithDeadline() + public void FibWithDeadline() { using (var call = client.Fib(new FibArgs { Limit = 0 }, deadline: DateTime.UtcNow.AddMilliseconds(500))) diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 625c1723bc..491d313f17 100755 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -8,6 +8,7 @@ Grpc.Examples Grpc.Examples 1.0.4 + true diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index 85b5e2dd96..0cc1b79137 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -52,9 +52,10 @@ namespace Math public override async Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) { long sum = 0; - await requestStream.ForEachAsync(async num => + await requestStream.ForEachAsync(num => { sum += num.Num_; + return TaskUtils.CompletedTask; }); return new Num { Num_ = sum }; } diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index b0e2716e7e..2ccf46b9b9 100755 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -10,6 +10,7 @@ Grpc.HealthCheck.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs index 7dadba75ff..45e8ad9062 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs @@ -37,7 +37,7 @@ namespace Grpc.HealthCheck.Tests Grpc.Health.V1.Health.HealthClient client; Grpc.HealthCheck.HealthServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new HealthServiceImpl(); @@ -54,7 +54,7 @@ namespace Grpc.HealthCheck.Tests client = new Grpc.Health.V1.Health.HealthClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj index 26a940e488..17797e1e1e 100644 --- a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj +++ b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj @@ -10,6 +10,7 @@ Grpc.Microbenchmarks $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj index af6ade852b..cf756c68ad 100755 --- a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj +++ b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj @@ -10,6 +10,7 @@ Grpc.Reflection.Tests $(PackageTargetFallback);portable-net45 1.0.4 + true diff --git a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs index 7e894edd31..76f8cfadcf 100644 --- a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs +++ b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs @@ -38,7 +38,7 @@ namespace Grpc.Reflection.Tests ServerReflection.ServerReflectionClient client; ReflectionServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new ReflectionServiceImpl(ServerReflection.Descriptor); @@ -55,7 +55,7 @@ namespace Grpc.Reflection.Tests client = new ServerReflection.ServerReflectionClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); -- cgit v1.2.3