public void Test_IsLogging_WhenLogCategoryIsInfo_AndIsFalse_ShouldReturnFalse_Info() { //---------------Set up test pack------------------- var log = GetBasicMockLog(); IHabaneroLogger logger = new Log4NetLoggerSpy(log); log.Stub(log2 => log2.IsInfoEnabled).Return(false); //---------------Assert Precondition---------------- log.AssertWasNotCalled(log1 => log1.IsInfoEnabled); //---------------Execute Test ---------------------- var isLogging = logger.IsLogging(LogCategory.Info); //---------------Test Result ----------------------- Assert.IsFalse(isLogging); log.AssertWasCalled(log1 => log1.IsInfoEnabled); }
public void Test_IsLogging_WhenLogCategoryIsException_AndIsTrue_ShouldReturnTrue_Error() { //---------------Set up test pack------------------- var log = GetBasicMockLog(); IHabaneroLogger logger = new Log4NetLoggerSpy(log); log.Stub(log2 => log2.IsErrorEnabled).Return(true); //---------------Assert Precondition---------------- log.AssertWasNotCalled(log1 => log1.IsErrorEnabled); //---------------Execute Test ---------------------- var isLogging = logger.IsLogging(LogCategory.Exception); //---------------Test Result ----------------------- Assert.IsTrue(isLogging); log.AssertWasCalled(log1 => log1.IsErrorEnabled); }