public void Equals_Object_ReturnsExpected(DesignerAttribute attribute, object other, bool expected) { Assert.Equal(expected, attribute.Equals(other)); if (other is DesignerAttribute) { Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode())); } }
public void Equals_Object_ReturnsExpected(DesignerAttribute attribute, object other, bool expected) { Assert.Equal(expected, attribute.Equals(other)); if (other is DesignerAttribute otherAttribute && attribute.DesignerBaseTypeName != null && otherAttribute.DesignerBaseTypeName != null) { Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode())); } }
public void GetHashCode_NullBaseDesignerTypeName_ThrowsNullReferenceExeption() { var attribute = new DesignerAttribute("designerTypeName", (string)null); Assert.Throws <NullReferenceException>(() => attribute.GetHashCode()); }