Skip to content

Commit

Permalink
Finished missed files
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimgoris committed Jan 28, 2025
1 parent 98e3d07 commit 81c1fa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Guard.Net" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Text.RegularExpressions;
using Arcus.Observability.Telemetry.Core;
using Arcus.Observability.Telemetry.Core.Logging;
using GuardNet;
using Xunit;

// ReSharper disable once CheckNamespace
Expand All @@ -27,7 +26,10 @@ public static class TestLoggerExtensions
/// <exception cref="InvalidOperationException">Thrown when no test message was written to the test <paramref name="logger"/>.</exception>
public static DependencyLogEntry GetMessageAsDependency(this TestLogger logger)
{
Guard.NotNull(logger, nameof(logger), "Requires a test logger to retrieve the written log message");
if (logger is null)
{
throw new ArgumentNullException(nameof(logger), "Requires a test logger to retrieve the written log message");
}

if (logger.WrittenMessage is null)
{
Expand Down Expand Up @@ -73,7 +75,10 @@ public static DependencyLogEntry GetMessageAsDependency(this TestLogger logger)
/// <exception cref="InvalidOperationException">Thrown when no test message was written to the test <paramref name="logger"/>.</exception>
public static RequestLogEntry GetMessageAsRequest(this TestLogger logger)
{
Guard.NotNull(logger, nameof(logger), "Requires a test logger to retrieve the written log message");
if (logger is null)
{
throw new ArgumentNullException(nameof(logger), "Requires a test logger to retrieve the written log message");
}

if (logger.WrittenMessage is null)
{
Expand Down Expand Up @@ -142,7 +147,10 @@ public static RequestLogEntry GetMessageAsRequest(this TestLogger logger)
/// <exception cref="InvalidOperationException">Thrown when no test message was written to the test <paramref name="logger"/>.</exception>
public static MetricLogEntry GetMessageAsMetric(this TestLogger logger)
{
Guard.NotNull(logger, nameof(logger), "Requires a test logger to retrieve the written log message");
if (logger is null)
{
throw new ArgumentNullException(nameof(logger), "Requires a test logger to retrieve the written log message");
}

if (logger.WrittenMessage is null)
{
Expand Down

0 comments on commit 81c1fa8

Please # to comment.