public void GetMessage_MessageNotSet_ReturnsNull() { //Arrange var loggerMock = new Mock<ILogger>(); IRepository repository = new Repository(loggerMock.Object); //Act var messageReceived = repository.GetMessage(); //Assert Assert.IsTrue(string.IsNullOrEmpty(messageReceived)); }
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()); }
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); }