Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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());
        }