diff --git a/test/Serilog.Tests/MethodOverloadConventionTests.cs b/test/Serilog.Tests/MethodOverloadConventionTests.cs index 1c03f55f6..8e8300823 100644 --- a/test/Serilog.Tests/MethodOverloadConventionTests.cs +++ b/test/Serilog.Tests/MethodOverloadConventionTests.cs @@ -305,9 +305,7 @@ public void ValidateIsEnabledMethods(Type loggerType) Assert.Equal(parameter.Name, "level"); Assert.Equal(parameter.ParameterType, typeof(LogEventLevel)); - CollectingSink sink; - - var logger = GetLogger(loggerType, out sink, LogEventLevel.Information); + var logger = GetLogger(loggerType, out _, LogEventLevel.Information); var falseResult = InvokeMethod(method, logger, new object[] { LogEventLevel.Verbose }); @@ -761,10 +759,7 @@ static void InvokeConventionMethod( static void InvokeConventionMethod(MethodInfo method, Type[] typeArgs, object[] parameters) { - CollectingSink sink; - LogEventLevel level; - - InvokeConventionMethod(method, typeArgs, parameters, out level, out sink); + InvokeConventionMethod(method, typeArgs, parameters, out _, out _); } static void InvokeConventionMethodAndTest(MethodInfo method, Type[] typeArgs, object[] parameters) @@ -901,9 +896,7 @@ static void EvaluateSingleResult(LogEventLevel level, CollectingSink results) static ILogger GetLogger(Type loggerType) { - CollectingSink sink; - - return GetLogger(loggerType, out sink); + return GetLogger(loggerType, out _); } static ILogger GetLogger(Type loggerType, out CollectingSink sink, LogEventLevel level = LogEventLevel.Verbose) @@ -940,4 +933,4 @@ static ILogger GetLogger(Type loggerType, out CollectingSink sink, LogEventLevel throw new ArgumentException($"Logger Type of {loggerType} is not supported"); } } -} \ No newline at end of file +}