Пример #1
0
        public void CreateBufferedCopy_Always_Returns_An_HttpMessageBuffer()
        {
            HttpRequestMessage request = new HttpRequestMessage();
            HttpMessage message = new HttpMessage(request);

            ExceptionAssert.Throws<NotSupportedException>(
                SR.MessageReadWriteCopyNotSupported("ToHttpRequestMessage", "ToHttpResponseMessage", typeof(Message).FullName),
                () =>
                {
                    MessageBuffer buffer = message.CreateBufferedCopy(5);
                });
        }
        public void CreateBufferedCopy_Always_Returns_An_HttpMessageBuffer()
        {
            HttpRequestMessage request = new HttpRequestMessage();
            HttpMessage        message = new HttpMessage(request);

            ExceptionAssert.Throws(
                typeof(NotSupportedException),
                "CreateBufferedCopy should have thrown because copying is not supported.",
                () =>
            {
                MessageBuffer buffer = message.CreateBufferedCopy(5);
            });
        }