public void SliceOfSliceMatchesCorrectOffset1Param() { using (FileStream fs = new FileStream("src/Stream/data/SimpleStream.txt", FileMode.Open)) { fs.Seek(1, SeekOrigin.Begin); SliceStream slice1 = new SliceStream(fs, fs.Length - 2); slice1.Seek(1, SeekOrigin.Begin); SliceStream slice2 = new SliceStream(slice1, slice1.Length - 2); fs.Seek(2, SeekOrigin.Begin); slice1.Seek(1, SeekOrigin.Begin); int data, data1, data2; data = fs.ReadByte(); data1 = slice1.ReadByte(); data2 = slice2.ReadByte(); // Reads through different slices at corresponding offsets should match up Assert.AreEqual(data, data1); Assert.AreEqual(data, data2); } }