public void Received_Data_Should_Match_Input() { int total = 0; byte[] buffer = new byte[150325]; while (true) { int read = InputStream.Read(buffer, 0, buffer.Length); ReceivedData.AddRange(buffer); total += read; if (read == 0) { break; } } Assert.AreEqual(200000 * 10, total); foreach (BufferedDataBlock db in Input) { var chunk = ReceivedData.GetRange((int)(db.BlockNumber * db.BlockLength), (int)db.BlockLength); CollectionAssert.AreEqual(db.Data, chunk); } }