This commit is contained in:
Stef Heyenrath
2021-03-18 14:29:13 +01:00
committed by GitHub
parent 3617e95db6
commit ddf2b49240
5 changed files with 133 additions and 66 deletions

View File

@@ -3,6 +3,7 @@
using System;
using WireMock.Matchers;
using WireMock.Matchers.Request;
using WireMock.Util;
using WireMock.Validation;
namespace WireMock.RequestBuilders
@@ -71,5 +72,14 @@ namespace WireMock.RequestBuilders
_requestMatchers.Add(new RequestMessageBodyMatcher(func));
return this;
}
/// <inheritdoc cref="IBodyRequestBuilder.WithBody(Func{IBodyData, bool})"/>
public IRequestBuilder WithBody(Func<IBodyData, bool> func)
{
Check.NotNull(func, nameof(func));
_requestMatchers.Add(new RequestMessageBodyMatcher(func));
return this;
}
}
}