Implemented #82

This commit is contained in:
Stef Heyenrath
2018-02-02 11:17:37 +01:00
parent 40ff8514ac
commit 66b2ff16de
15 changed files with 464 additions and 349 deletions

View File

@@ -0,0 +1,41 @@
using System;
using NFluent;
using WireMock.Matchers.Request;
using WireMock.RequestBuilders;
using Xunit;
namespace WireMock.Net.Tests
{
public class RequestWithUrlTests
{
private const string ClientIp = "::1";
[Fact]
public void Request_WithUrl()
{
// given
var spec = Request.Create().WithUrl("*/foo");
// when
var request = new RequestMessage(new Uri("http://localhost/foo"), "blabla", ClientIp);
// then
var requestMatchResult = new RequestMatchResult();
Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0);
}
[Fact]
public void Request_WithUrlExact()
{
// given
var spec = Request.Create().WithUrl("http://localhost/foo");
// when
var request = new RequestMessage(new Uri("http://localhost/foo"), "blabla", ClientIp);
// then
var requestMatchResult = new RequestMatchResult();
Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0);
}
}
}