コード例 #1
0
 private void CheckWithoutContentType(IHttpRequestContentPattern contentPattern, byte[] rightContentBytes, string rightContentType)
 {
     contentPattern.IsMatch(rightContentBytes, rightContentType).ShouldBeEquivalentTo(true);
     contentPattern.IsMatch(GenBytes(), rightContentType).ShouldBeEquivalentTo(false);
     contentPattern.IsMatch(rightContentBytes, GenString()).ShouldBeEquivalentTo(true);
     contentPattern.IsMatch(GenBytes(), GenString()).ShouldBeEquivalentTo(false);
 }
コード例 #2
0
        public IHttpRequestMock Content(IHttpRequestContentPattern httpRequestContentPattern)
        {
            if (httpRequestContentPattern == null)
            {
                throw new ArgumentNullException(nameof(httpRequestContentPattern));
            }

            httpRequestMock.Content = httpRequestContentPattern;
            return(this);
        }
コード例 #3
0
        public void TestAny()
        {
            IHttpRequestContentPattern contentPattern = ContentPattern.Any();

            contentPattern.IsMatch(GenBytes(), GenString()).ShouldBeEquivalentTo(true);
        }