예제 #1
0
        public void ByteEquals_returns_false_if_right_is_null()
        {
            var arr = new ushort[] { 1, 2 };

            ArrayComparer.ByteEquals(arr, null)
            .Should().BeFalse();
        }
예제 #2
0
        public void ByteEquals_returns_true_for_ref_equals()
        {
            var arr = new ushort[] { 1, 2 };

            ArrayComparer.ByteEquals(arr, arr)
            .Should().BeTrue();
        }
예제 #3
0
        public void ByteEquals_returns_false_for_different_size_array()
        {
            var arr  = new ushort[] { 1, 2 };
            var arr2 = new ushort[] { 1, 2, 3 };

            ArrayComparer.ByteEquals(arr, arr2)
            .Should().BeFalse();
        }
예제 #4
0
 public void ByteEquals_returns_true_if_elements_match()
 {
     for (int i = 1; i < 20; i++)
     {
         var arr  = Enumerable.Range(1, i).Select(e => (ushort)e).ToArray();
         var arr2 = new ushort[arr.Length];
         Array.Copy(arr, arr2, arr.Length);
         ArrayComparer.ByteEquals(arr, arr2)
         .Should().BeTrue();
     }
 }
예제 #5
0
 public bool Equals(VectorKey other)
 {
     if (other == null)
     {
         return(false);
     }
     if (_hashCode != other._hashCode)
     {
         return(false);
     }
     return(ArrayComparer.ByteEquals(_vector, other._vector));
 }
예제 #6
0
 public void ByteEquals_returns_true_for_nulls()
 {
     ArrayComparer.ByteEquals(null, null)
     .Should().BeTrue();
 }