public void TestVeryComplex(int seedX, int seedY) { VeryComplexClass x = new VeryComplexClass(seedX); VeryComplexClass y = new VeryComplexClass(seedY); Assert.Equal(x.Equals(y), LazyEquality.Equals(x, y)); }
public void TestNotEqualToHashSet(string xs, string ys) { IEnumerable <char> x = xs; IEnumerable <char> y = new HashSet <char>(ys); Assert.False(LazyEquality.Equals(x, y)); }
public void TestDifferentEnumerables(string xs, string ys) { IEnumerable <char> x = xs.ToList(); IEnumerable <char> y = new LinkedList <char>(ys); Assert.Equal(xs == ys, LazyEquality.Equals(x, y)); }
static void Main(string[] args) { Console.WriteLine(new SomeClass(1, 2) == new SomeClass(1, 2)); Console.WriteLine(new SomeClass(1, 2) == new SomeClass(1, 3)); Console.WriteLine(new SomeClass(1, 2, 3, 3) == new SomeClass(1, 2, 3, 4)); Console.WriteLine(new SomeClass(1, 2, 3, 3) == new SomeClass(1, 2, 3, 3)); Console.WriteLine(new SomeClass(1, 2, 5, 5) == new SomeClass(1, 3, 5, 5)); Console.WriteLine(LazyEquality.Equals <IEnumerable>(new ArrayList(new[] { 1, 2, 3 }), (new[] { 1, 2, 3 }))); Console.WriteLine(LazyEquality.Equals(new ArrayList(new[] { 1, 2, 3 }), new ArrayList(new[] { 1, 2, 4 }))); }
public void TestMemberwiseLists(int[] seedsX, int[] seedsY) { var x = new LinkedList <ComplexClassWithInts>( seedsX.Select(z => new ComplexClassWithInts(new Random(z))) ); var y = new LinkedList <ComplexClassWithInts>( seedsY.Select(z => new ComplexClassWithInts(new Random(z))) ); Assert.Equal(x.SequenceEqual(y), LazyEquality.Equals(x, y)); }
public bool Equals(NativeEquatableWrapper other) => LazyEquality.Equals(this, other);
public void TestEnum(SomeEnum x, SomeEnum y) { Assert.Equal(x == y, LazyEquality.Equals(x, y)); }
public void TestInterfaced(int x, int y) { Assert.Equal(x == y, LazyEquality.Equals(new LazyIEquatableClass(x), new LazyIEquatableClass(y))); }
public bool Equals(LazyIEquatableClass other) => LazyEquality.Equals(this, other);
public override bool Equals(object obj) => LazyEquality.Equals(this, obj as SomeClass);
public static bool operator ==(SomeClass x, SomeClass y) => LazyEquality.Equals(x, y);