From b021add5e489052d2b7823e72634e87e296f3b26 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Dec 2018 15:17:52 +0100 Subject: C#: avoid unnecessary ifdefine in NUnitMain.cs --- src/csharp/Grpc.Core.Tests/NUnitMain.cs | 6 +----- src/csharp/Grpc.Examples.Tests/NUnitMain.cs | 6 +----- src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs | 6 +----- src/csharp/Grpc.IntegrationTesting/NUnitMain.cs | 6 +----- src/csharp/Grpc.Reflection.Tests/NUnitMain.cs | 6 +----- src/csharp/Grpc.Tools.Tests/NUnitMain.cs | 4 ---- 6 files changed, 5 insertions(+), 29 deletions(-) (limited to 'src/csharp') diff --git a/src/csharp/Grpc.Core.Tests/NUnitMain.cs b/src/csharp/Grpc.Core.Tests/NUnitMain.cs index 221a6b823a..3b206603f1 100644 --- a/src/csharp/Grpc.Core.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Core.Tests/NUnitMain.cs @@ -34,11 +34,7 @@ namespace Grpc.Core.Tests { // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. GrpcEnvironment.SetLogger(new ConsoleLogger()); -#if NETCOREAPP1_1 || NETCOREAPP2_1 - return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); -#else - return new AutoRun().Execute(args); -#endif + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); } } } diff --git a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs index 0b9a5258ef..107df64809 100644 --- a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs @@ -34,11 +34,7 @@ namespace Grpc.Examples.Tests { // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. GrpcEnvironment.SetLogger(new ConsoleLogger()); -#if NETCOREAPP1_1 || NETCOREAPP2_1 - return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); -#else - return new AutoRun().Execute(args); -#endif + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); } } } diff --git a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs index f5091863b8..db6d32a5b2 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs @@ -34,11 +34,7 @@ namespace Grpc.HealthCheck.Tests { // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. GrpcEnvironment.SetLogger(new ConsoleLogger()); -#if NETCOREAPP1_1 || NETCOREAPP2_1 - return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); -#else - return new AutoRun().Execute(args); -#endif + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); } } } diff --git a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs index 6265953622..4135186275 100644 --- a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs +++ b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs @@ -34,11 +34,7 @@ namespace Grpc.IntegrationTesting { // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. GrpcEnvironment.SetLogger(new ConsoleLogger()); -#if NETCOREAPP1_1 || NETCOREAPP2_1 - return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); -#else - return new AutoRun().Execute(args); -#endif + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); } } } diff --git a/src/csharp/Grpc.Reflection.Tests/NUnitMain.cs b/src/csharp/Grpc.Reflection.Tests/NUnitMain.cs index 1be7f6542b..de4b4af6cf 100644 --- a/src/csharp/Grpc.Reflection.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Reflection.Tests/NUnitMain.cs @@ -34,11 +34,7 @@ namespace Grpc.Reflection.Tests { // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. GrpcEnvironment.SetLogger(new ConsoleLogger()); -#if NETCOREAPP1_1 || NETCOREAPP2_1 - return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); -#else - return new AutoRun().Execute(args); -#endif + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); } } } diff --git a/src/csharp/Grpc.Tools.Tests/NUnitMain.cs b/src/csharp/Grpc.Tools.Tests/NUnitMain.cs index 13ba8b51d0..d30d608aa3 100644 --- a/src/csharp/Grpc.Tools.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Tools.Tests/NUnitMain.cs @@ -24,10 +24,6 @@ namespace Grpc.Tools.Tests static class NUnitMain { public static int Main(string[] args) => -#if NETCOREAPP1_1 || NETCOREAPP2_1 new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args); -#else - new AutoRun().Execute(args); -#endif }; } -- cgit v1.2.3