public static HttpCallAssertion WithExactBody(this HttpCallAssertion assert, string body) { return(assert.With(fc => { fc.RequestBody.Should().Be(body); return true; })); }
public static HttpCallAssertion WithJsonPropertyMatching(this HttpCallAssertion a, Func <dynamic, string> propertyPicker, string regex) => a.With(r => propertyPicker.Invoke(JObject.Parse(r.RequestBody)).Matches(new Regex(regex)));
public static HttpCallAssertion WithJsonProperty <TProperty>(this HttpCallAssertion a, Func <dynamic, TProperty> propertyPicker, TProperty expected) where TProperty : IEquatable <TProperty> => a.With(r => ((TProperty)propertyPicker.Invoke(JObject.Parse(r.RequestBody))).Equals(expected));