C#: avoid unnecessary ifdefine in NUnitMain.cs

pull/17376/head
Jan Tattermusch 6 years ago
parent 0e717e4655
commit b021add5e4
  1. 6
      src/csharp/Grpc.Core.Tests/NUnitMain.cs
  2. 6
      src/csharp/Grpc.Examples.Tests/NUnitMain.cs
  3. 6
      src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
  4. 6
      src/csharp/Grpc.IntegrationTesting/NUnitMain.cs
  5. 6
      src/csharp/Grpc.Reflection.Tests/NUnitMain.cs
  6. 4
      src/csharp/Grpc.Tools.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);
}
}
}

@ -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);
}
}
}

@ -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);
}
}
}

@ -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);
}
}
}

@ -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);
}
}
}

@ -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
};
}

Loading…
Cancel
Save