public void BeTrueForTypeWithArrays() { var ctors = new Dictionary <Type, Func <object> > { { typeof(NonDefaultConstructor), () => new NonDefaultConstructor(5) } }; var result = HasStructural.Equality(typeof(HasArrays), ctors); Assert.True(result); }
public void BeTrueForComplexTypeThatImplementsStructuralEqualityWithConstructorPassedIn() { var ctors = new Dictionary <Type, Func <object> > { { typeof(NonDefaultConstructor), () => new NonDefaultConstructor(5) } }; var result = HasStructural.Equality(typeof(SomeComplexClass), ctors); Assert.True(result); }
public void BeTrueForTypeThatImplementsStructuralEqualityWithConstructorPassedIn() { var ctors = new Dictionary <Type, Func <object> > { { typeof(OtherClassWithEquality), () => new OtherClassWithEquality { SomeNumber = 789 } }, }; var result = HasStructural.Equality(typeof(OtherClassWithEquality), ctors); Assert.True(result); }
public void BeFalseForBasicTypeWithConstructorPassed() { var ctors = new Dictionary <Type, Func <object> > { { typeof(AnotherClass), () => new AnotherClass { SomeNumber = 11, SomeString = "12", someChar = (char)13, someByte = 14 } } }; var result = HasStructural.Equality(typeof(AnotherClass), ctors); Assert.False(result); }
public void SupportStructuralEquality() { var hasEquality = HasStructural.Equality(typeof(VersionInfo)); Assert.True(hasEquality); }
public void BeTrueForTypeThatImplementsStructuralEquality() { var result = HasStructural.Equality(typeof(OtherClassWithEquality)); Assert.True(result); }
public void BeFalseForBasicType() { var result = HasStructural.Equality(typeof(AnotherClass)); Assert.False(result); }