public void TestReadAllAndLength(string chunkedData, string dechunkedData) { var stream = new DechunkedStream(new ByteArray(ASCIIEncoding.ASCII.GetBytes(chunkedData))); Assert.Equal(dechunkedData, ASCIIEncoding.ASCII.GetString(stream.ReadBytes())); stream = new DechunkedStream(new ByteArray(ASCIIEncoding.ASCII.GetBytes(chunkedData))); Assert.Equal(dechunkedData.Length, stream.Length); }
public void TestPartialRead(string chunkedData, long start, int length, string dechunkedData) { var stream = new DechunkedStream(new ByteArray(ASCIIEncoding.ASCII.GetBytes(chunkedData))); Assert.Equal(dechunkedData, ASCIIEncoding.ASCII.GetString(stream.ReadBytes(start, length))); }