Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query string args are required for route to resolve #5

Open
NearlyUnique opened this issue Jul 19, 2016 · 4 comments
Open

Query string args are required for route to resolve #5

NearlyUnique opened this issue Jul 19, 2016 · 4 comments

Comments

@NearlyUnique
Copy link

NearlyUnique commented Jul 19, 2016

I'd expect this to pass if added to Tests.cs

https://github.com/TinyBlueRobots/Hornbill/blob/master/src/Tests.CSharp/Tests.cs

It resolves to 404

[Test]
public void IgnoreQueryString()
{
    using (var fakeService = new FakeService())
    using (var httpClient = HttpClient(fakeService.Start()))
    {
        fakeService.AddResponse("/test", Method.GET, Response.WithStatusCode(418));
        Assert.That((int)httpClient.GetAsync("/test?foo=bar").Result.StatusCode, Is.EqualTo(418));
        Assert.That((int)httpClient.GetAsync("/test?foo=baz").Result.StatusCode, Is.EqualTo(418));
    }
}
@NearlyUnique
Copy link
Author

Although I did find that making it a regex with .* on the end will work

@JonCanning
Copy link
Contributor

My thinking was to force test cases to be explicit so there's no surprises. The pattern is always a regex, so we should put that in the docs.

What do you think @CraftyFella ?

@CraftyFella
Copy link
Contributor

This caught me out today too.. so possibly worth considering.

@CraftyFella
Copy link
Contributor

Adding to docs makes sense to me.. shall I do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants