コード例 #1
0
        public void DoesNotHaveChangesWhenSameIntegrationGeneratedSpan()
        {
            var collector = new IntegrationTelemetryCollector();

            collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings()));

            collector.GetData();
            collector.HasChanges().Should().BeFalse();

            collector.IntegrationGeneratedSpan(IntegrationId);
            collector.HasChanges().Should().BeTrue();
            collector.GetData();

            collector.IntegrationGeneratedSpan(IntegrationId);
            collector.HasChanges().Should().BeFalse();
        }
コード例 #2
0
        public void WhenIntegrationRunsSuccessfullyHasExpectedValues()
        {
            var collector = new IntegrationTelemetryCollector();

            collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings()));

            collector.IntegrationRunning(IntegrationId);
            collector.IntegrationGeneratedSpan(IntegrationId);

            var data        = collector.GetData();
            var integration = data.FirstOrDefault(x => x.Name == IntegrationName);

            integration.Should().NotBeNull();
            integration.AutoEnabled.Should().BeTrue();
            integration.Enabled.Should().BeTrue();
            integration.Error.Should().BeNull();
        }
コード例 #3
0
        public void WhenIntegrationRunsThenErrorsHasExpectedValues()
        {
            const string error     = "Some error";
            var          collector = new IntegrationTelemetryCollector();

            collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings()));

            collector.IntegrationRunning(IntegrationId);
            collector.IntegrationGeneratedSpan(IntegrationId);
            collector.IntegrationDisabledDueToError(IntegrationId, error);

            var data        = collector.GetData();
            var integration = data.FirstOrDefault(x => x.Name == IntegrationName);

            integration.Should().NotBeNull();
            integration.AutoEnabled.Should().BeTrue();
            integration.Enabled.Should().BeTrue();
            integration.Error.Should().Be(error);
        }