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()); }
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()); }
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()); }