mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-18 15:23:47 +01:00
update tests
This commit is contained in:
@@ -338,10 +338,10 @@ namespace WireMock.Net.Tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_body_using_SimMetricsMatcher()
|
||||
public void Should_specify_requests_matching_given_body_using_SimMetricsMatcher1()
|
||||
{
|
||||
// given
|
||||
var requestBuilder = Request.Create().UsingAnyVerb().WithBody("The cat walks in the street.");
|
||||
var requestBuilder = Request.Create().UsingAnyVerb().WithBody(new SimMetricsMatcher("The cat walks in the street."));
|
||||
|
||||
// when
|
||||
string bodyAsString = "The car drives in the street.";
|
||||
@@ -353,6 +353,22 @@ namespace WireMock.Net.Tests
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsLessThan(1.0).And.IsGreaterThan(0.5);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_body_using_SimMetricsMatcher2()
|
||||
{
|
||||
// given
|
||||
var requestBuilder = Request.Create().UsingAnyVerb().WithBody(new SimMetricsMatcher("The cat walks in the street."));
|
||||
|
||||
// when
|
||||
string bodyAsString = "Hello";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", body, bodyAsString);
|
||||
|
||||
// then
|
||||
var requestMatchResult = new RequestMatchResult();
|
||||
Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsLessThan(0.1).And.IsGreaterThan(0.05);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_specify_requests_matching_given_body_using_WildcardMatcher()
|
||||
{
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
<HintPath>..\..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimMetrics.Net, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SimMetrics.Net.1.0.1.0\lib\net45\SimMetrics.Net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
|
||||
@@ -4,4 +4,5 @@
|
||||
<package id="Moq" version="4.5.30" targetFramework="net452" />
|
||||
<package id="NFluent" version="1.3.1.0" targetFramework="net452" />
|
||||
<package id="NUnit" version="3.6.0" targetFramework="net452" />
|
||||
<package id="SimMetrics.Net" version="1.0.1.0" targetFramework="net452" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user