/// <summary> /// Matches a request by partially matching the request content. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="partialContent">The request content.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching PartialContent(this RequestMatching builder, Stream partialContent) { if (partialContent is null) { throw new ArgumentNullException(nameof(partialContent)); } using var ms = new MemoryStream(); partialContent.CopyTo(ms); return(builder.PartialContent(ms.ToArray())); }
/// <summary> /// Matches a request by partially matching the request content. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="partialContent">The request content.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching PartialContent(this RequestMatching builder, string partialContent) { return(builder.PartialContent(partialContent, ContentMatcher.DefaultEncoding)); }