mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-21 00:50:24 +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
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user