Example #1
0
        public void ReadOnlyBuffersOfEqualValuesInSameOrderAreSequentiallyAndStructurallyEqual(byte[] bytes, int start, int length)
        {
            var bytesCopy = bytes.ToArray();

            var buffer       = new ReadOnlyMemory <byte>(bytes, start, length);
            var ofSameValues = new ReadOnlyMemory <byte>(bytesCopy, start, length);

            Assert.True(buffer.SequenceEqual(ofSameValues));
            Assert.True(ofSameValues.SequenceEqual(buffer));
            Assert.True(buffer.SequenceEqual(ofSameValues));
            Assert.True(ofSameValues.SequenceEqual(buffer));

            Assert.False(buffer.Equals(ofSameValues));
            Assert.False(ofSameValues.Equals(buffer));
        }