示例#1
0
        public void Seek_Not_Supported()
        {
            ActionStream actionStream = new ActionStream(new StreamActions());

            Assert.Throws <NotSupportedException>(() =>
            {
                actionStream.Seek(1, SeekOrigin.Begin);
            });
        }
示例#2
0
        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);
        }