using System; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Validation; namespace WireMock.RequestBuilders { public partial class Request { /// public IRequestBuilder WithBody(string body, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) { _requestMatchers.Add(new RequestMessageBodyMatcher(matchBehaviour, body)); return this; } /// public IRequestBuilder WithBody(byte[] body, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) { _requestMatchers.Add(new RequestMessageBodyMatcher(matchBehaviour, body)); return this; } /// public IRequestBuilder WithBody(object body, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) { _requestMatchers.Add(new RequestMessageBodyMatcher(matchBehaviour, body)); return this; } /// public IRequestBuilder WithBody(IMatcher matcher) { return WithBody(new[] { matcher }); } /// public IRequestBuilder WithBody(IMatcher[] matchers) { Check.NotNull(matchers, nameof(matchers)); _requestMatchers.Add(new RequestMessageBodyMatcher(matchers)); return this; } /// public IRequestBuilder WithBody(Func func) { Check.NotNull(func, nameof(func)); _requestMatchers.Add(new RequestMessageBodyMatcher(func)); return this; } /// public IRequestBuilder WithBody(Func func) { Check.NotNull(func, nameof(func)); _requestMatchers.Add(new RequestMessageBodyMatcher(func)); return this; } /// public IRequestBuilder WithBody(Func func) { Check.NotNull(func, nameof(func)); _requestMatchers.Add(new RequestMessageBodyMatcher(func)); return this; } } }