Esempio n. 1
0
        public void TestSByte()
        {
            var rnd = new System.Random();

            for (var c = 0; c < count; c++)
            {
                var mem   = new byte[sizeof(SByte) * writeRepeatCount];
                var span1 = new SpanStream(mem);
                var span2 = new SpanStream(mem);
                var a     = new sbyte[writeRepeatCount];

                for (var i = 0; i < writeRepeatCount; i++)
                {
                    var n = rnd.NextSByte();
                    a[i] = n;
                    span1.Write(n);
                }

                for (var i = 0; i < writeRepeatCount; i++)
                {
                    var r = span2.ReadSByte();
                    Assert.Equal(a[i], r);
                }
            }
        }