public void Seek_Not_Supported() { ActionStream actionStream = new ActionStream(new StreamActions()); Assert.Throws <NotSupportedException>(() => { actionStream.Seek(1, SeekOrigin.Begin); }); }
public void Seek(long testOffset, SeekOrigin testOrigin) { long expectedOffset = 0; SeekOrigin expectedOrigin = SeekOrigin.Begin; ActionStream actionStream = new ActionStream(new StreamActions { Seek = (offset, origin) => { expectedOffset = offset; expectedOrigin = origin; return(0); } }); actionStream.Seek(testOffset, testOrigin); Assert.Equal(testOffset, expectedOffset); Assert.Equal(testOrigin, expectedOrigin); }