public void PublishingMetricWorksCorrectly() { // arrange using (var httpDummy = new HttpMockFixture()) { httpDummy.SetupServer(); // act AppInsightClient.TrackMetric("Test", 12.2); AppInsightClient.Flush(); // assert httpDummy.CallCount.Should().Be(1); } }
public void MetricIsNotPublishedIfPublishingIsDisabled() { // arrange using (var httpDummy = new HttpMockFixture()) { httpDummy.SetupServer(); AppInsightClient.TrackTelemetry = false; // act AppInsightClient.TrackMetric("Test", 10.5); AppInsightClient.Flush(); // assert httpDummy.PathWasCalled.Should().BeFalse(); AppInsightClient.TrackTelemetry = true; } }