public void evaluate_the_beatpulse_path()
        {
            var options = new BeatPulseOptions();

            var httpContext = new DefaultHttpContext();

            httpContext.Request.Method = "GET";
            httpContext.Request.Path   = "/hc";

            httpContext.GetBeatPulseRequestPath(options)
            .Should().BeEquivalentTo(string.Empty);

            httpContext.Request.Path = "/hc/sqlserver";

            httpContext.GetBeatPulseRequestPath(options)
            .Should().BeEquivalentTo("sqlserver");

            options.ConfigurePath("health");

            httpContext.Request.Path = "/health";

            httpContext.GetBeatPulseRequestPath(options)
            .Should().BeEquivalentTo(string.Empty);

            httpContext.Request.Path = "/health/sqlserver";

            httpContext.GetBeatPulseRequestPath(options)
            .Should().BeEquivalentTo("sqlserver");
        }
        public void change_default_beatpulse_path()
        {
            var options = new BeatPulseOptions();

            options.Path
            .Should().Be(BeatPulseKeys.BEATPULSE_DEFAULT_PATH);

            options.ConfigurePath("health");

            options.Path
            .Should().Be("health");
        }
예제 #3
0
        public void return_true_if_request_is_beaptulse_request()
        {
            var options = new BeatPulseOptions();

            var httpContext = new DefaultHttpContext();

            httpContext.Request.Method = "GET";
            httpContext.Request.Path   = "/hc";

            httpContext.IsBeatPulseRequest(options)
            .Should().BeTrue();

            options.ConfigurePath("health");

            httpContext.Request.Method = "GET";
            httpContext.Request.Path   = "/health";

            httpContext.IsBeatPulseRequest(options)
            .Should().BeTrue();
        }