public void OpenXmlAttributeTest() { OpenXmlAttribute target = new OpenXmlAttribute(); OpenXmlAttribute other = new OpenXmlAttribute(); Assert.NotEqual(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); target = new OpenXmlAttribute("test", "http://test", "test", "value"); other = new OpenXmlAttribute("test", "http://test", "test", "value"); Assert.NotEqual(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Value = "other"; Assert.NotEqual(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(OpenXmlAttribute.Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); other.Value = "value"; Assert.NotEqual(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Prefix = "t"; Assert.NotEqual(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(OpenXmlAttribute.Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); }
public void DefaultOpenXmlAttributeTest() { var target = new OpenXmlAttribute(); var other = new OpenXmlAttribute(); Assert.Equal(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); }
public void OpenXmlAttributeTest() { #pragma warning disable CS0618 // Type or member is obsolete var target = new OpenXmlAttribute("test", "http://test", "test", "value"); var other = new OpenXmlAttribute("test", "http://test", "test", "value"); Assert.Equal(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Value = "other"; Assert.NotEqual(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); other.Value = "value"; Assert.Equal(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Prefix = "t"; Assert.NotEqual(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); #pragma warning restore CS0618 // Type or member is obsolete }
public void OpenXmlAttributeTest() { OpenXmlAttribute target = new OpenXmlAttribute(); OpenXmlAttribute other = new OpenXmlAttribute(); Assert.NotSame(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); target = new OpenXmlAttribute("test", "http://test", "test", "value"); other = new OpenXmlAttribute("test", "http://test", "test", "value"); Assert.NotSame(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Value = "other"; Assert.NotSame(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(OpenXmlAttribute.Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); other.Value = "value"; Assert.NotSame(target, other); Assert.True(target == other); Assert.False(target != other); Assert.True(target.Equals(other)); Assert.True(target.Equals((object)other)); Assert.True(OpenXmlAttribute.Equals(target, other)); Assert.Equal(target.GetHashCode(), other.GetHashCode()); other.Prefix = "t"; Assert.NotSame(target, other); Assert.False(target == other); Assert.True(target != other); Assert.False(target.Equals(other)); Assert.False(target.Equals((object)other)); Assert.False(OpenXmlAttribute.Equals(target, other)); Assert.NotEqual(target.GetHashCode(), other.GetHashCode()); }