-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoggerMock.cs
29 lines (27 loc) · 1.05 KB
/
LoggerMock.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
_loggerMock.Verify(
x => x.Log(
LogLevel.Warning,
EventIds.MissingRequiredDocumentProperty,
It.Is<It.IsAnyType>((message, _) => string.Equals(
"Missing required property name(s): correlationId,@timestamp.",
message.ToString())),
It.IsAny<Exception>(),
It.Is<Func<It.IsAnyType, Exception, string>>((_, _) => true)),
Times.Once);
_loggerMock.Setup(x => x.IsEnabled(It.IsAny<LogLevel>())).Returns(true);
_loggerMock.Setup(
x => x.Log(
LogLevel.Warning,
EventIds.ShuttingDownWithUnsavedItems,
It.IsAny<It.IsAnyType>(),
It.IsAny<Exception>(),
It.Is<Func<It.IsAnyType, Exception, string>>((_, _) => true)));
// Assert
_loggerMock.Verify(
x => x.Log(
LogLevel.Warning,
EventIds.ShuttingDownWithUnsavedItems,
It.IsAny<It.IsAnyType>(),
It.IsAny<Exception>(),
It.IsAny<Func<It.IsAnyType, Exception, string>>()),
Times.Never());