Пример #1
0
        public void Given_Path_Mismatch_Request_Router_Finds_NoConfiguredRoute()
        {
            // Arrange
            Request request = new Request("/api/testing/router/targets/1", HttpRequestMethod.GET);

            // Act
            RouteConfiguration routeConfiguration = GuardianRouter.GetConfiguredRoute(request);

            // Assert
            routeConfiguration.Should().BeNull();
        }
Пример #2
0
        public void Given_Request_Router_Finds_ConfiguredRoute()
        {
            // Arrange
            Request request = new Request("/api/testing/router/target/1", HttpRequestMethod.GET);

            // Act
            RouteConfiguration routeConfiguration = GuardianRouter.GetConfiguredRoute(request);

            // Assert
            routeConfiguration.Should().NotBeNull();
            routeConfiguration.Path.Should().Be(@"^/api/testing/router/target/");
            routeConfiguration.RequestMethod.Should().Be(HttpRequestMethod.GET);
        }