コード例 #1
0
        public bool Equals(Needle <T> other)
        {
            var target = _target;

            if (target == null)
            {
                return(other._target == null);
            }
            return(EqualsExtracted(this, other));
        }
コード例 #2
0
        private static bool NotEqualsExtracted(Needle <T> left, Needle <T> right)
        {
            if (ReferenceEquals(left, null))
            {
                return(!ReferenceEquals(right, null));
            }
            if (ReferenceEquals(right, null))
            {
                return(true);
            }
            var leftTarget  = left._target;
            var rightTarget = right._target;

            if (leftTarget == null)
            {
                return(rightTarget != null);
            }
            if (rightTarget == null)
            {
                return(true);
            }
            return(!leftTarget.Equals(rightTarget));
        }