mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-16 07:06:54 +01:00
* Lower priority from Proxy mappings * Fix codefactor * extra tests * #205 * Fix test for linux * `c:\temp\x.json` fix * Extra tests * more tests * more tests * codefactor * #200 * refactor * refactor * tests
33 lines
1022 B
C#
33 lines
1022 B
C#
using System.Collections.Generic;
|
|
using NFluent;
|
|
using WireMock.Matchers;
|
|
using WireMock.Matchers.Request;
|
|
using WireMock.Models;
|
|
using WireMock.RequestBuilders;
|
|
using WireMock.Util;
|
|
using Xunit;
|
|
|
|
namespace WireMock.Net.Tests
|
|
{
|
|
public class RequestBuilderUsingMethodTests
|
|
{
|
|
[Fact]
|
|
public void RequestBuilder_UsingAnyMethod_ClearsAllOtherMatches()
|
|
{
|
|
// Assign
|
|
var requestBuilder = (Request)Request.Create().UsingGet();
|
|
|
|
// Assert 1
|
|
var matchers = requestBuilder.GetPrivateFieldValue<IList<IRequestMatcher>>("_requestMatchers");
|
|
Check.That(matchers.Count()).IsEqualTo(1);
|
|
Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageMethodMatcher));
|
|
|
|
// Act
|
|
requestBuilder.UsingAnyMethod();
|
|
|
|
// Assert 2
|
|
matchers = requestBuilder.GetPrivateFieldValue<IList<IRequestMatcher>>("_requestMatchers");
|
|
Check.That(matchers.Count()).IsEqualTo(0);
|
|
}
|
|
}
|
|
} |