A telemetry initializer that determines if the request came from a synthetic source based on the user agent string.
Наследование: WebTelemetryInitializerBase
Пример #1
0
        public void SyntheticSourceIsNotSetIfContextIsNull()
        {
            var eventTelemetry = new EventTelemetry("name");
            var source         = new SyntheticUserAgentTelemetryInitializer();

            source.Filters = this.botSubstrings;

            source.Initialize(eventTelemetry);

            Assert.IsNull(eventTelemetry.Context.Operation.SyntheticSource);
        }
        public void SyntheticSourceIsNotSetIfContextIsNull()
        {
            var eventTelemetry = new EventTelemetry("name");
            var source = new SyntheticUserAgentTelemetryInitializer();

            source.Filters = this.botSubstrings;

            source.Initialize(eventTelemetry);

            Assert.IsNull(eventTelemetry.Context.Operation.SyntheticSource);
        }