diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2015-03-11 18:21:00 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2015-03-11 18:23:53 -0700 |
commit | 075dde42fe1a78db8fb80cfbd48e34327e9b383e (patch) | |
tree | 0f632242988ee224d09147c9dfad0a51bbb190d5 /src/csharp/Grpc.Core.Tests | |
parent | 053d894e2c7482c16c256ef0f3eca1bb41efdf2c (diff) |
code style fixes based on StyleCop warnings
Diffstat (limited to 'src/csharp/Grpc.Core.Tests')
-rw-r--r-- | src/csharp/Grpc.Core.Tests/ClientServerTest.cs | 8 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs | 2 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/PInvokeTest.cs | 35 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs | 10 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/ServerTest.cs | 1 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/TimespecTest.cs | 1 |
6 files changed, 23 insertions, 34 deletions
diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 39be35c219..e73159b350 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -122,10 +122,13 @@ namespace Grpc.Core.Tests { var call = new Call<string, string>(unaryEchoStringMethod, channel); - try { + try + { Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken)); Assert.Fail(); - } catch(RpcException e) { + } + catch (RpcException e) + { Assert.AreEqual(StatusCode.Unimplemented, e.Status.StatusCode); } } @@ -140,4 +143,3 @@ namespace Grpc.Core.Tests } } } - diff --git a/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs b/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs index 596918c231..6a132a5b22 100644 --- a/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs +++ b/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs @@ -68,7 +68,7 @@ namespace Grpc.Core.Tests var tp2 = GrpcEnvironment.ThreadPool; GrpcEnvironment.Shutdown(); - Assert.IsFalse(Object.ReferenceEquals(tp1, tp2)); + Assert.IsFalse(object.ReferenceEquals(tp1, tp2)); } } } diff --git a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs index 9db08d2f02..3beffc3955 100644 --- a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs +++ b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs @@ -33,13 +33,13 @@ using System; using System.Diagnostics; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Grpc.Core; using Grpc.Core.Internal; using Grpc.Core.Utils; using NUnit.Framework; -using System.Runtime.InteropServices; namespace Grpc.Core.Tests { @@ -73,14 +73,13 @@ namespace Grpc.Core.Tests { BenchmarkUtil.RunBenchmark( 100000, 1000000, - () => { + () => + { CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create(); cq.Dispose(); - } - ); + }); } - /// <summary> /// Approximate results: /// (~80ns Mono Linux) @@ -94,10 +93,10 @@ namespace Grpc.Core.Tests counter = 0; BenchmarkUtil.RunBenchmark( 1000000, 10000000, - () => { + () => + { grpcsharp_test_callback(handler); - } - ); + }); Assert.AreNotEqual(0, counter); } @@ -113,10 +112,10 @@ namespace Grpc.Core.Tests counter = 0; BenchmarkUtil.RunBenchmark( 10000, 10000, - () => { - grpcsharp_test_callback(new CompletionCallbackDelegate(Handler)); - } - ); + () => + { + grpcsharp_test_callback(new CompletionCallbackDelegate(Handler)); + }); Assert.AreNotEqual(0, counter); } @@ -129,15 +128,15 @@ namespace Grpc.Core.Tests { BenchmarkUtil.RunBenchmark( 1000000, 100000000, - () => { + () => + { grpcsharp_test_nop(IntPtr.Zero); - } - ); + }); } - private void Handler(GRPCOpError op, IntPtr ptr) { - counter ++; + private void Handler(GRPCOpError op, IntPtr ptr) + { + counter++; } } } - diff --git a/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs index 499d931d2a..e4328806ad 100644 --- a/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs @@ -1,8 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. [assembly: AssemblyTitle("Grpc.Core.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -11,12 +9,4 @@ using System.Runtime.CompilerServices; [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("0.1.*")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/src/csharp/Grpc.Core.Tests/ServerTest.cs b/src/csharp/Grpc.Core.Tests/ServerTest.cs index dd30366f6a..12f914bfad 100644 --- a/src/csharp/Grpc.Core.Tests/ServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ServerTest.cs @@ -53,6 +53,5 @@ namespace Grpc.Core.Tests GrpcEnvironment.Shutdown(); } - } } diff --git a/src/csharp/Grpc.Core.Tests/TimespecTest.cs b/src/csharp/Grpc.Core.Tests/TimespecTest.cs index 0ca84ec44b..f5bae6d935 100644 --- a/src/csharp/Grpc.Core.Tests/TimespecTest.cs +++ b/src/csharp/Grpc.Core.Tests/TimespecTest.cs @@ -86,4 +86,3 @@ namespace Grpc.Core.Internal.Tests } } } - |