示例#1
0
        public void AddContentChunk_EmptyMessageBodyAndGivenSomeData_ContentIsTheSame()
        {
            // Arrange
            var messageBody = new HttpMessageBody();
            var content     = new List <byte> {
                0x41, 0x41, 0x41, 0x41
            };

            // Act
            messageBody.AddContentChunk(content);

            // Assert
            CollectionAssert.AreEqual(content, messageBody.GetContent());
        }
示例#2
0
        public void AddContentChunk_AddTwoChunks_GetContentReturnsCombinedContent()
        {
            // Arrange
            var messageBody = new HttpMessageBody();
            var content     = new List <byte> {
                0x41, 0x41, 0x41, 0x41
            };

            messageBody.AddContentChunk(content);

            // Act
            messageBody.AddContentChunk(content);

            // Assert
            content.AddRange(content);
            CollectionAssert.AreEqual(content, messageBody.GetContent());
        }
示例#3
0
        public void GetContent_SetContentToASequenceOfBytes_ReturnsTheSameList()
        {
            // Arrange
            var messageBody = new HttpMessageBody();
            var bytes       = new List <byte>
            {
                45,
                67,
                82,
                16,
                0,
                255
            };

            // Act
            messageBody.SetContent(bytes);

            // Assert
            CollectionAssert.AreEqual(bytes, messageBody.GetContent());
        }