Esempio n. 1
0
        public bool Equals(Needle <T> other)
        {
            var target = _target;

            if (target == null)
            {
                return(other._target == null);
            }
            return(EqualsExtracted(this, other));
        }
Esempio n. 2
0
        public bool Equals(Needle <T> other)
        {
            if (other is null)
            {
                return(false);
            }

            var leftTarget  = _target;
            var rightTarget = other._target;

            if (leftTarget == null)
            {
                return(rightTarget == null);
            }

            return(rightTarget != null && leftTarget.Equals(rightTarget));
        }
Esempio n. 3
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 (ReferenceEquals(leftTarget, null))
            {
                return(!ReferenceEquals(rightTarget, null));
            }
            if (ReferenceEquals(rightTarget, null))
            {
                return(true);
            }
            return(!leftTarget.Equals(rightTarget));
        }
Esempio n. 4
0
        private static bool EqualsExtracted(Needle <T> left, Needle <T> right)
        {
            if (ReferenceEquals(left, null))
            {
                return(ReferenceEquals(right, null));
            }
            if (ReferenceEquals(right, null))
            {
                return(false);
            }
            var leftTarget  = left._target;
            var rightTarget = right._target;

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