Beispiel #1
0
        public void PassOtherRequestTest()
        {
            var next      = Substitute.For <ITelemetryProcessor>();
            var processor = new ExcludeLocalhostPingProcessor(next);

            var request = new RequestTelemetry {
                Url = new Uri("http://localhost:5000")
            };

            processor.Process(request);
            next.Received().Process(request);

            request = new RequestTelemetry {
                Url = new Uri("https://example.com")
            };
            processor.Process(request);
            next.Received().Process(request);
        }
Beispiel #2
0
        public void SkipLocalhostRequestTest()
        {
            var next      = Substitute.For <ITelemetryProcessor>();
            var processor = new ExcludeLocalhostPingProcessor(next);
            var request   = new RequestTelemetry {
                Url = new Uri("http://localhost")
            };

            processor.Process(request);

            next.Received(0).Process(request);
        }