Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 2ca3fc0

Browse files
test: sonarQube issue fix
1 parent 0bfbc8b commit 2ca3fc0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/ServiceLayer.Mesh.Tests/Functions/MeshHandshakeFunctionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public async Task Run_ExceptionThrown_LogsErrorAndCompletion()
101101
It.IsAny<EventId>(),
102102
It.IsAny<It.IsAnyType>(),
103103
expectedException,
104-
It.IsAny<Func<It.IsAnyType, Exception, string>>()),
104+
It.IsAny<Func<It.IsAnyType, Exception?, string>>()),
105105
Times.Once);
106106
}
107107

@@ -111,9 +111,9 @@ private void VerifyLogMessage(LogLevel level, string expectedMessage)
111111
x => x.Log(
112112
level,
113113
It.IsAny<EventId>(),
114-
It.Is<It.IsAnyType>((v, t) => v.ToString().Contains(expectedMessage)),
115-
It.IsAny<Exception>(),
116-
It.IsAny<Func<It.IsAnyType, Exception, string>>()),
114+
It.Is<It.IsAnyType>((v, t) => (v.ToString() ?? string.Empty).Contains(expectedMessage)),
115+
It.IsAny<Exception?>(),
116+
It.IsAny<Func<It.IsAnyType, Exception?, string>>()),
117117
Times.Once);
118118
}
119119
}

0 commit comments

Comments
 (0)