コード例 #1
0
 public void WritingAnErrorMessageToTheDatabaseShouldStoreAnErrorMessage()
 {
     using (var source = new TestLoggingSource())
     {
         var before = source.ErrorLogQuery().Count();
         var loggingService = new LoggingService(source);
         loggingService.Log("Test", LogLevel.Error);
         var after = source.ErrorLogQuery().Count();
         Assert.IsTrue(after == before + 1);
     }
 }
コード例 #2
0
 public void WritingAnAuditMessageToTheDatabaseShouldStoreAnAuditMessage()
 {
     using (var source = new TestLoggingSource())
     {
         var before = source.AuditLogQuery().Count();
         var loggingService = new LoggingService(source);
         loggingService.LogToAudit("Test", "AuditTest");
         var after = source.AuditLogQuery().Count();
         Assert.IsTrue(after == before + 1);
     }
 }