mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-20 00:25:06 +01:00
Solve #10
This commit is contained in:
@@ -19,7 +19,7 @@ namespace WireMock.Net.Tests.Http
|
||||
public class TinyHttpServerTests
|
||||
{
|
||||
[Test]
|
||||
public void Should_Call_Handler_on_Request()
|
||||
public void Should_call_handler_on_request()
|
||||
{
|
||||
// given
|
||||
var port = Ports.FindFreeTcpPort();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace WireMock.Net.Tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_url_and_method()
|
||||
public void Should_specify_requests_matching_given_url_and_method_put()
|
||||
{
|
||||
// given
|
||||
var spec = Request.WithUrl("/foo").UsingPut();
|
||||
@@ -83,6 +83,58 @@ namespace WireMock.Net.Tests
|
||||
Check.That(spec.IsSatisfiedBy(request)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_url_and_method_post()
|
||||
{
|
||||
// given
|
||||
var spec = Request.WithUrl("/foo").UsingPost();
|
||||
|
||||
// when
|
||||
var request = new RequestMessage("/foo", string.Empty, "POST", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(spec.IsSatisfiedBy(request)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_url_and_method_get()
|
||||
{
|
||||
// given
|
||||
var spec = Request.WithUrl("/foo").UsingGet();
|
||||
|
||||
// when
|
||||
var request = new RequestMessage("/foo", string.Empty, "GET", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(spec.IsSatisfiedBy(request)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_url_and_method_delete()
|
||||
{
|
||||
// given
|
||||
var spec = Request.WithUrl("/foo").UsingDelete();
|
||||
|
||||
// when
|
||||
var request = new RequestMessage("/foo", string.Empty, "DELETE", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(spec.IsSatisfiedBy(request)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_url_and_method_head()
|
||||
{
|
||||
// given
|
||||
var spec = Request.WithUrl("/foo").UsingHead();
|
||||
|
||||
// when
|
||||
var request = new RequestMessage("/foo", string.Empty, "HEAD", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(spec.IsSatisfiedBy(request)).IsTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_exclude_requests_matching_given_url_but_not_http_method()
|
||||
{
|
||||
@@ -227,3 +279,4 @@ namespace WireMock.Net.Tests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user