public void Equals() { TextValue v1 = new TextValue("Hello World"); TextValue v2 = new TextValue("hELLO wORLD"); Assert.IsTrue(v1.Equals(v2)); Assert.IsFalse(v1.Equals(new TextValue("Hello Worl"))); }
public void EqualsTest1() { TextValue target = new TextValue("my value"); TextValue operand = new TextValue("my value"); bool expected = true; bool actual; actual = target.Equals(operand); Assert.AreEqual(expected, actual); operand = new TextValue("my other value"); expected = false; actual = target.Equals(operand); Assert.AreEqual(expected, actual); }
public void UnansEquals3() { TextValue uv1 = new TextValue(); TextValue uv2 = new TextValue(); uv1.Equals(uv2); }
public void UnansEquals2() { TextValue v = new TextValue("Hello World"); TextValue uv = new TextValue(); v.Equals(uv); }
public void UnansEquals1() { TextValue v = new TextValue("Hello World"); TextValue uv = new TextValue(); uv.Equals(v); }
public bool Equals(OpportunityDetail other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( DetailId == other.DetailId || DetailId != null && DetailId.Equals(other.DetailId) ) && ( TextValue == other.TextValue || TextValue != null && TextValue.Equals(other.TextValue) ) && ( DttmValue == other.DttmValue || DttmValue != null && DttmValue.Equals(other.DttmValue) ) && ( IntValue == other.IntValue || IntValue != null && IntValue.Equals(other.IntValue) )); }
public override bool Equals(object o) { if (this == o) { return(true); } if (o == null || GetType() != o.GetType()) { return(false); } var that = (FilledAutofillField)o; if (TextValue != null ? !TextValue.Equals(that.TextValue) : that.TextValue != null) { return(false); } if (DateValue != null ? !DateValue.Equals(that.DateValue) : that.DateValue != null) { return(false); } return(ToggleValue != null?ToggleValue.Equals(that.ToggleValue) : that.ToggleValue == null); }
public void EqualsTest() { TextValue target = new TextValue("Test"); object obj = "Test"; // string bool expected = false; // we expect them not to be equal because they are not the same type. // Implicit conversion from string to TextValue does not take effect here. // However, even if it did, that might be fine too... this test is just asserting the expected (but not required) behavior. bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); obj = new TextValue("Test"); expected = true; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } if (obj is null || GetType() != obj.GetType()) { return(false); } var other = (MatchTextExpression)obj; return(TargetAttribute.Equals(other.TargetAttribute) && TextValue.Equals(other.TextValue) && MatchKind == other.MatchKind); }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null || GetType() != obj.GetType()) { return(false); } FilledAutofillField that = (FilledAutofillField)obj; if (!TextValue?.Equals(that.TextValue) ?? that.TextValue != null) { return(false); } if (DateValue != null ? !DateValue.Equals(that.DateValue) : that.DateValue != null) { return(false); } return(ToggleValue != null?ToggleValue.Equals(that.ToggleValue) : that.ToggleValue == null); }