コード例 #1
0
        public void TelemetryIsAcceptedByValidateEndpoint()
        {
            this.appendableLogger.Logger.Debug("Trace Debug");

            ITelemetry telemetry = this.appendableLogger.SentItems.First();

            Assert.IsNull(TelemetrySender.ValidateEndpointSend(telemetry));
        }
コード例 #2
0
        public void TelemetryIsAcceptedByValidateEndpoint()
        {
            Logger aiLogger = this.CreateTargetWithGivenInstrumentationKey();

            aiLogger.Debug("Message");

            var telemetry = (TraceTelemetry)this.adapterHelper.Channel.SentItems.First();

            Assert.IsNull(TelemetrySender.ValidateEndpointSend(telemetry));
        }
        public void TelemetryIsAcceptedByValidateEndpoint()
        {
            TelemetryConfiguration.Active.TelemetryChannel = this.adapterHelper.Channel;

            using (var listener = new ApplicationInsightsTraceListener(Guid.NewGuid().ToString()))
            {
                listener.WriteLine("A Message to write line");

                TraceTelemetry telemetry = (TraceTelemetry)this.adapterHelper.Channel.SentItems.First();

                Assert.IsNull(TelemetrySender.ValidateEndpointSend(telemetry));
            }
        }
        public void TelemetryIsAcceptedByValidateEndpoint()
        {
#pragma warning disable CS0618 // Type or member is obsolete
            TelemetryConfiguration.Active.TelemetryChannel = this.adapterHelper.Channel;
#pragma warning restore CS0618 // Type or member is obsolete

            using (var listener = new ApplicationInsightsTraceListener(Guid.NewGuid().ToString()))
            {
                listener.WriteLine("A Message to write line");

                TraceTelemetry telemetry = (TraceTelemetry)this.adapterHelper.Channel.SentItems.First();

                Assert.IsNull(TelemetrySender.ValidateEndpointSend(telemetry));
            }
        }
コード例 #5
0
        public MeadowApp()
        {
            _bluetooth = new Hc06(Device, Device.SerialPortNames.Com4);

            CycleCount        = 0;
            DispatchTime      = 0;
            TelemetrySendTime = 0;

            _layout = new Layout("control", this);

            //Components
            _sensorReader    = new SensorReader(Device, _layout);
            _telemetrySender = new TelemetrySender(new DeviceStream(_bluetooth), TelemetryConfig.Meadow, _layout);

            _lookup = _layout.GetLookup();
        }
コード例 #6
0
        public void when_sending_trace_telemetry_no_errors_occur()
        {
            var fakeChannel = new FakeTelemetryChannel();
            var config      = new TelemetryConfiguration
            {
                TelemetryChannel   = fakeChannel,
                InstrumentationKey = "FAKE_KEY"
            };
            var client = new TelemetryClient(config);

            var sut   = new TelemetrySender(client);
            var trace = new TraceTelemetry("Test", SeverityLevel.Information);

            sut.SendTrace(trace);

            var sentTrace = fakeChannel.CapturedTelemetry.OfType <TraceTelemetry>().Single();

            Assert.Equal(trace, sentTrace);
        }