public void EqualsTest1() { CPair <string> target = new CPair <string>(_First, _Second); CPair <string> other = new CPair <string>(_First, _Second); Assert.IsTrue(target.Equals(other)); target.Second = "dfghgfgh"; Assert.IsFalse(target.Equals(other)); }
public void EqualsTest() { CPair <string> target = new CPair <string>(_First, _Second); object obj = null; Assert.IsFalse(target.Equals(obj)); obj = new CPair <string>(_First, _Second); Assert.IsTrue(target.Equals(obj)); obj = new CPair <int>(34, 3434); Assert.IsFalse(target.Equals(obj)); }
/// <summary> /// Определяет, равны ли 2 фрагмента кода /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(CCommentedCodeFragment other) { if (other == null) { return(false); } if (Object.ReferenceEquals(this, other)) { return(true); } return(m_CommentSymbolPair.Equals(other.m_CommentSymbolPair) && m_Position.Equals(other.m_Position)); }