public void ByteEquals_returns_false_if_right_is_null() { var arr = new ushort[] { 1, 2 }; ArrayComparer.ByteEquals(arr, null) .Should().BeFalse(); }
public void ByteEquals_returns_true_for_ref_equals() { var arr = new ushort[] { 1, 2 }; ArrayComparer.ByteEquals(arr, arr) .Should().BeTrue(); }
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(); }
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(); } }
public bool Equals(VectorKey other) { if (other == null) { return(false); } if (_hashCode != other._hashCode) { return(false); } return(ArrayComparer.ByteEquals(_vector, other._vector)); }
public void ByteEquals_returns_true_for_nulls() { ArrayComparer.ByteEquals(null, null) .Should().BeTrue(); }