public void Clear_LoggerCalledCorrecty_CalledWithCorrectMessage() { //Arrange const string messageSent = "Called from clear"; var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act repository.Clear(); //Assert loggerMock.Verify(logger => logger.Log(messageSent)); }
public void Clear_MessageSet_SetCorrectly() { //Arrange const string messageSent = "Called from clear"; var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act repository.Clear(); //Assert Assert.AreEqual(messageSent, repository.GetMessage()); }