public void SendMessage_NullMessage_NoScopeReturned() { var applicationInsightsHelper = new ServiceBusTelemetryHelper(FakeConnectionString); var scope = applicationInsightsHelper.BeginMessageSendingScope((Message)null, "FakeEntityPath"); Assert.IsInstanceOfType(scope, typeof(NoScope)); }
public async Task BeginEndMessageProcessScope_Success() { var mockMessage = new Message(); var applicationInsightsHelper = new ServiceBusTelemetryHelper(FakeConnectionString); using (var scope = applicationInsightsHelper.BeginMessageProcessingScope(mockMessage, "FakeEntityPath")) { // Simulate some work await Task.Delay(50).ConfigureAwait(false); scope.SetSuccess(true); } }