예제 #1
0
        /// <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()));
        }
예제 #2
0
 /// <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));
 }