public void Load_LoggerCalledCorrecty_CalledOnce() { //Arrange const string messageSent = "Called from load"; var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act repository.Load(); //Assert loggerMock.Verify(logger => logger.Log(messageSent), Times.Exactly(1)); }
public void Load_MessageSet_SetCorrectly() { //Arrange const string messageSent = "Called from load"; var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act repository.Load(); //Assert Assert.AreEqual(messageSent, repository.GetMessage()); }
public void Load_MessageText_IsCorrect() { //Arrange var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act repository.Load(); var receivedMessage = repository.GetMessage(); //Assert Assert.AreEqual("Called from load", receivedMessage); }