C#: avoid unnecessary ifdefine in NUnitMain.cs
This commit is contained in:
parent
0e717e4655
commit
b021add5e4
|
|
@ -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…
Reference in New Issue