public void SendRequest_FailsWithNullQueue() { ConcurrentQueue <string> testQueue = null; _metricsPublisher.SendRequest(testQueue, "testPath").GetAwaiter().GetResult(); Assert.Matches("Failed to publish status to testPath", _testLoggerProvider.GetAllLogMessages().Single().FormattedMessage); Assert.Matches("NullReferenceException", _testLoggerProvider.GetAllLogMessages().Single().Exception.ToString()); Assert.Equal(LogLevel.Error, _testLoggerProvider.GetAllLogMessages().Single().Level); }
public void SendRequest_FailsWithNullQueue() { ConcurrentQueue <string> testQueue = null; Assert.Throws <NullReferenceException>(() => _metricsPublisher.SendRequest(testQueue, "testPath").GetAwaiter().GetResult()); }