Example #1
0
 public void StopAsync_LogListenerDetails()
 {
     try
     {
         Assert.DoesNotThrow(() => _listener.StopAsync(CancellationToken.None));
         Assert.NotNull(_loggerProvider.GetAllLogMessages()
                        .SingleOrDefault(x => x.FormattedMessage.StartsWith("Attempting to stop ServiceBus listener")));
         Assert.NotNull(_loggerProvider.GetAllLogMessages()
                        .SingleOrDefault(x => x.FormattedMessage.StartsWith("ServiceBus listener stopped")));
     }
     finally
     {
         _loggerProvider.ClearAllLogMessages();
     }
 }
 public void StopAsync_LogListenerDetails()
 {
     Assert.ThrowsAsync <InvalidOperationException>(() => _listener.StopAsync(CancellationToken.None));
     Assert.NotNull(_loggerProvider.GetAllLogMessages().SingleOrDefault(x => x.FormattedMessage.StartsWith("ServiceBus listener stopped")));
 }