public void WhenUsingAnEmptyLookupDictionaryThenNoRouteIsMatched() { var lookup = new ProxiedApiRouteEndpointLookup(new Dictionary <string, string>()); var found = lookup.TryGet("/non-existent-route", out _); Assert.False(found); }
public void WhenLookingUpANonExistentRouteThenNothingIsFound(string nonExistentRoute) { var lookup = new ProxiedApiRouteEndpointLookup(new Dictionary <string, string> { ["test-route"] = "test-endpoint", ["another-test-route"] = "another-test-endpoint" }); var found = lookup.TryGet(nonExistentRoute, out _); Assert.False(found); }
public void WhenLookingUpExistingRouteThenItIsFound(string route, string expectedEndpoint) { var lookup = new ProxiedApiRouteEndpointLookup( new Dictionary <string, string> { ["test-route"] = "test-endpoint", ["another-test-route"] = "another-test-endpoint" }); var found = lookup.TryGet(route, out var endpoint); Assert.True(found); Assert.Equal(expectedEndpoint, endpoint); }