public void Error_string_ShouldPassFakeLogger() { var factory = new FakeILoggerFactory(); new WebLogger(factory).LogError("error1"); var error = factory.Storage.ErrorLog[0]; var logLevel = factory.Storage.LogLevelLog[0]; Assert.AreEqual("error1", error); Assert.AreEqual(LogLevel.Error, logLevel); }
public void Information_Exception_ShouldPassFakeLogger() { var factory = new FakeILoggerFactory(); var expectedException = new Exception("some thing bad happens"); new WebLogger(factory).LogInformation(expectedException, "message_ex"); var error = factory.Storage.ErrorLog[0]; var logLevel = factory.Storage.LogLevelLog[0]; Assert.AreEqual(expectedException.Message, error); Assert.AreEqual(LogLevel.Information, logLevel); }