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(); }
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(); }
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); }