예제 #1
0
        private static bool Equals(ConstantMatcher obj1, ConstantMatcher obj2)
        {
            if (Object.Equals(null, obj1) ||
                Object.Equals(null, obj2) ||
                obj1.GetType() != obj2.GetType())
                return false;

            if (Object.ReferenceEquals(obj1, obj2)) return true;

            return Tuple.Create<Type, object>(obj1.ArgumentType, obj1.MatchValue).Equals(
                Tuple.Create<Type, object>(obj2.ArgumentType, obj2.MatchValue));
        }
예제 #2
0
        private static bool Equals(ConstantMatcher obj1, ConstantMatcher obj2)
        {
            if (Object.Equals(null, obj1) ||
                Object.Equals(null, obj2) ||
                obj1.GetType() != obj2.GetType())
            {
                return(false);
            }

            if (Object.ReferenceEquals(obj1, obj2))
            {
                return(true);
            }

            return(Tuple.Create <Type, object>(obj1.ArgumentType, obj1.MatchValue).Equals(
                       Tuple.Create <Type, object>(obj2.ArgumentType, obj2.MatchValue)));
        }
예제 #3
0
 public override bool Equals(object obj)
 {
     return(ConstantMatcher.Equals(this, obj as ConstantMatcher));
 }