Skip to content

Commit

Permalink
fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Jun 27, 2023
1 parent 5073a0b commit 4587a7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/Polly.Extensions/Telemetry/Log.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Logging;

namespace Polly.Extensions.Telemetry;

#pragma warning disable S107 // Methods should not have too many parameters

[ExcludeFromCodeCoverage]
internal static partial class Log
{
[LoggerMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,6 @@ public void WriteExecutionAttempt_LoggingWithOutcome_Ok(bool noOutcome, bool han
}

messages[0].LogLevel.Should().Be(LogLevel.Warning);

// verify reported state
var coll = messages[0].State.Should().BeAssignableTo<IReadOnlyList<KeyValuePair<string, object>>>().Subject;
coll.Count.Should().Be(9);
coll.AsEnumerable().Should().HaveCount(9);
(coll as IEnumerable).GetEnumerator().Should().NotBeNull();

for (int i = 0; i < coll.Count; i++)
{
if (!noOutcome)
{
coll[i].Value.Should().NotBeNull();
}
}

coll.Invoking(c => c[coll.Count + 1]).Should().Throw<IndexOutOfRangeException>();
}

[Fact]
Expand Down

0 comments on commit 4587a7a

Please sign in to comment.