Skip to content

Commit

Permalink
(nunit): major update
Browse files Browse the repository at this point in the history
  • Loading branch information
fb-smit committed Jan 30, 2024
1 parent ca43df0 commit 5d6dfc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<PackageVersion Version="4.5.0" Include="NUnit3TestAdapter" />
<PackageVersion Version="5.1.0" Include="NSubstitute" />
<PackageVersion Version="1.0.16" Include="NSubstitute.Analyzers.CSharp" />
<PackageVersion Version="3.14.0" Include="NUnit" />
<PackageVersion Version="4.0.1" Include="NUnit" />
<PackageVersion Version="1.2.1.1" Include="NUnit.Allure" />
<PackageVersion Version="4.1.5" Include="Unleash.Client" />
<PackageVersion Version="3.0.24" Include="Vogen" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using FluentAssertions;
using Microsoft.AspNetCore.Http;
using NUnit.Framework;
using PiBox.Hosting.WebHost.Logging;
Expand All @@ -17,7 +18,7 @@ public void TestDetermineLoggingIsSettingTheLevelToErrorForTheGivenPathsStatusco
StructuredLoggingExtensions.DetermineRequestLogLevel(new[] { "/metrics-text" })(httpContext, 0,
null);

Assert.AreEqual(LogEventLevel.Error, logLevel);
LogEventLevel.Error.Should().Be(logLevel);
}

[Test]
Expand All @@ -31,7 +32,7 @@ public void TestDetermineLoggingIsSettingTheLevelToErrorForTheGivenPathsExceptio
StructuredLoggingExtensions.DetermineRequestLogLevel(new[] { "/metrics-text" })(httpContext, 0,
new Exception("test"));

Assert.AreEqual(LogEventLevel.Error, logLevel);
LogEventLevel.Error.Should().Be(logLevel);
}

[Test]
Expand All @@ -45,7 +46,7 @@ public void TestDetermineLoggingIsExcludingTheGivenPaths()
StructuredLoggingExtensions.DetermineRequestLogLevel(new[] { "/MeTRICS", "/metrics" })(httpContext,
0, null);

Assert.AreEqual(LogEventLevel.Verbose, logLevel);
LogEventLevel.Verbose.Should().Be(logLevel);
}

[Test]
Expand All @@ -58,7 +59,7 @@ public void TestDetermineLoggingIsExcludingTheGivenWildcardPaths()
StructuredLoggingExtensions.DetermineRequestLogLevel(new[] { "/MeTRICS", "/metrics*" })(
httpContext, 0, null);

Assert.AreEqual(LogEventLevel.Verbose, logLevel);
LogEventLevel.Verbose.Should().Be(logLevel);
}

[Test]
Expand All @@ -71,7 +72,7 @@ public void TestDetermineLoggingIsNotExcludingTheGivenWildcardPaths()
var logLevel =
StructuredLoggingExtensions.DetermineRequestLogLevel(new[] { "/hangfire*" })(httpContext, 0, null);

Assert.AreEqual(LogEventLevel.Information, logLevel);
LogEventLevel.Information.Should().Be(logLevel);
}

[TestCase("/metrics-text", new[] { "/MeTRICS", "/metrics" }, 499, null)]
Expand All @@ -86,7 +87,7 @@ public void TestDetermineLoggingIsNotExcludingTheGivenPaths(string actualPath, I
var logLevel =
StructuredLoggingExtensions.DetermineRequestLogLevel(paths)(httpContext, 0, exception);

Assert.AreEqual(LogEventLevel.Information, logLevel);
LogEventLevel.Information.Should().Be(logLevel);
}
}
}

0 comments on commit 5d6dfc6

Please sign in to comment.