Ejemplo n.º 1
0
        public virtual void TrySkipEndOfBufTestMethod(byte[] serialized)
        {
            int  read;
            bool success;

            success = Base128.TrySkip(source: serialized.AsSpan(0, serialized.Length - 1), read: out read);
            Assert.IsFalse(success);
            Assert.AreEqual(expected: 0, actual: read);
        }
Ejemplo n.º 2
0
        public virtual void TrySkipTestMethod(byte[] serialized)
        {
            int  read;
            bool success;

            success = Base128.TrySkip(source: serialized, read: out read);
            Assert.IsTrue(success);
            Assert.AreEqual(expected: serialized.Length, actual: read);
        }
Ejemplo n.º 3
0
        public virtual void TrySkipLongerBufTestMethod(byte[] serialized)
        {
            Span <byte> buf = stackalloc byte[serialized.Length + 1];
            int         read;
            bool        success;

            serialized.AsSpan().CopyTo(buf);
            success = Base128.TrySkip(source: buf, read: out read);
            Assert.IsTrue(success);
            Assert.AreEqual(expected: serialized.Length, actual: read);
        }