コード例 #1
0
        public void TestGuid()
        {
            for (var c = 0; c < count; c++)
            {
                var mem   = new byte[16 * writeRepeatCount];
                var span1 = new SpanStream(mem);
                var span2 = new SpanStream(mem);
                var a     = new Guid[writeRepeatCount];

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

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