public void Equals_Object_ReturnsExpected(CategoryAttribute attribute, object other, bool expected) { Assert.Equal(expected, attribute.Equals(other)); if (other is CategoryAttribute otherAttribute && otherAttribute.Category != null) { Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode())); } }
public void GetHashCode_NullCategory_ThrowsNullReferenceException() { var attribute = new CategoryAttribute(null); Assert.Throws <NullReferenceException>(() => attribute.GetHashCode()); }