Exemple #1
0
        public void ProcessMessage_NullMessage_NoScopeReturned()
        {
            var applicationInsightsHelper = new ServiceBusTelemetryHelper(FakeConnectionString);
            var scope = applicationInsightsHelper.BeginMessageProcessingScope(null, "FakeEntityPath");

            Assert.IsInstanceOfType(scope, typeof(NoScope));
        }
Exemple #2
0
        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);
            }
        }