public void TestWrite() { var buffer = new byte[(int)chained.Length]; for (int i = 0; i < buffer.Length; i++) { buffer[i] = (byte)(i & 0xff); } chained.Position = 0; chained.Write(buffer, 0, buffer.Length); chained.Flush(); var array = backing.ToArray(); for (int i = 0; i < buffer.Length; i++) { Assert.AreEqual(buffer[i], array[i], "Written byte @ offset {0} did not match", i); } }