public bool Equals(FilterSpecParamConstant other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(base.Equals(other) && Equals(other._filterConstant, _filterConstant)); }
public void TestEquals() { FilterSpecParam c1 = new FilterSpecParamConstant(Make("a"), FilterOperator.GREATER, 5); FilterSpecParam c2 = new FilterSpecParamConstant(Make("a"), FilterOperator.GREATER, 6); FilterSpecParam c3 = new FilterSpecParamConstant(Make("b"), FilterOperator.GREATER, 5); FilterSpecParam c4 = new FilterSpecParamConstant(Make("a"), FilterOperator.EQUAL, 5); FilterSpecParam c5 = new FilterSpecParamConstant(Make("a"), FilterOperator.GREATER, 5); Assert.IsFalse(c1.Equals(c2)); Assert.IsFalse(c1.Equals(c3)); Assert.IsFalse(c1.Equals(c4)); Assert.IsTrue(c1.Equals(c5)); }