public void Equality_ReallyTheSame() { var a = new TypeShape { TypeHierarchy = SomeTypeHierarchy, NestedTypes = { Names.Type("T2,P") }, Delegates = { new DelegateTypeName() }, EventHierarchies = { new EventHierarchy() }, Fields = { new FieldName() }, MethodHierarchies = { new MethodHierarchy() }, PropertyHierarchies = { new PropertyHierarchy() } }; var b = new TypeShape { TypeHierarchy = SomeTypeHierarchy, NestedTypes = { Names.Type("T2,P") }, Delegates = { new DelegateTypeName() }, EventHierarchies = { new EventHierarchy() }, Fields = { new FieldName() }, MethodHierarchies = { new MethodHierarchy() }, PropertyHierarchies = { new PropertyHierarchy() } }; Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public override int GetHashCode() { unchecked { var hashCode = 397; hashCode = (hashCode * 397) ^ TypeShape.GetHashCode(); hashCode = (hashCode * 397) ^ SST.GetHashCode(); return(hashCode); } }
public void Equality_DifferentProperties() { var a = new TypeShape { PropertyHierarchies = { new PropertyHierarchy() } }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentMethods() { var a = new TypeShape { MethodHierarchies = { new MethodHierarchy() } }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentFields() { var a = new TypeShape { Fields = { new FieldName() } }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentDelegates() { var a = new TypeShape { Delegates = { new DelegateTypeName() } }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentNestedTypes() { var a = new TypeShape { NestedTypes = { Names.Type("T2,P") } }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentType() { var a = new TypeShape { TypeHierarchy = SomeTypeHierarchy }; var b = new TypeShape(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }