public void HasChangesWhenNewIntegrationDisabled() { var collector = new IntegrationTelemetryCollector(); collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings())); collector.GetData(); collector.HasChanges().Should().BeFalse(); collector.IntegrationDisabledDueToError(IntegrationId, "Testing!"); collector.HasChanges().Should().BeTrue(); }
public void HasChangesWhenNewIntegrationGeneratedSpan() { var collector = new IntegrationTelemetryCollector(); collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings())); collector.GetData(); collector.HasChanges().Should().BeFalse(); collector.IntegrationGeneratedSpan(IntegrationId); collector.HasChanges().Should().BeTrue(); }
public void DoesNotHaveChangesWhenSameIntegrationRunning() { var collector = new IntegrationTelemetryCollector(); collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings())); collector.GetData(); collector.HasChanges().Should().BeFalse(); collector.IntegrationRunning(IntegrationId); collector.HasChanges().Should().BeTrue(); collector.GetData(); collector.IntegrationRunning(IntegrationId); collector.HasChanges().Should().BeFalse(); }
public void WhenIntegrationRunsButDoesNotGenerateSpanHasExpectedValues() { var collector = new IntegrationTelemetryCollector(); collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings())); collector.IntegrationRunning(IntegrationId); var data = collector.GetData(); var integration = data.FirstOrDefault(x => x.Name == IntegrationName); integration.Should().NotBeNull(); integration.AutoEnabled.Should().BeTrue(); integration.Enabled.Should().BeFalse(); integration.Error.Should().BeNull(); }
public void WhenIntegrationErrorsHasExpectedValues() { const string error = "Some error"; var collector = new IntegrationTelemetryCollector(); collector.RecordTracerSettings(new ImmutableTracerSettings(new TracerSettings())); collector.IntegrationRunning(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().BeFalse(); integration.Error.Should().Be(error); }