Пример #1
0
 public void Compare_TwoSameConditions(ICondition left, ICondition right)
 {
     Assert.Multiple(() =>
     {
         Assert.AreEqual(left, right);
         Assert.AreEqual(left.GetHashCode(), right.GetHashCode());
     });
 }
Пример #2
0
        public bool Equals(ICondition other)
        {
            if (other == null)
            {
                return(false);
            }

            return(GetHashCode() == other.GetHashCode());
        }
Пример #3
0
            public override int GetHashCode()
            {
                unchecked
                {
                    var hashCode = _logicalConjunction != null?_logicalConjunction.GetHashCode() : 0;

                    hashCode = (hashCode * 397) ^ (_condition != null ? _condition.GetHashCode() : 0);
                    hashCode = (hashCode * 397) ^
                               (_customDescription != null ? _customDescription.GetHashCode() : 0);
                    hashCode = (hashCode * 397) ^ (_reason != null ? _reason.GetHashCode() : 0);
                    return(hashCode);
                }
            }