Last active
October 28, 2019 05:50
-
-
Save xplicit/957f634cccdbcef3f369026b562f3fe9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readonly Mock<ILog> log4netMock = new Mock<ILog>(); | |
[Test] | |
public void SingleSendActionWithException_ErrorLoggedOnce() | |
{ | |
Smock.Run(context => | |
{ | |
// Arrange | |
context.Setup(() => LogManager.GetLogger(It.IsAny<Type>())).Returns(log4netMock.Object); | |
var logglyQueue = new LogglyQueue(); | |
// Act | |
logglyQueue.SendAction(new ActionMessage { Status = Status.Start }); | |
// Assert | |
log4netMock.Verify(l => l.Error(It.IsAny<object>(), It.IsAny<Exception>()), Times.Once); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment