Beispiel #1
0
        public static bool Equals(object firstArray, object otherArray, ArrayEquality equality)
        {
            Debug.Assert(firstArray.GetType().IsArray, firstArray + " is not an array");
            Debug.Assert(otherArray.GetType().IsArray, otherArray + " is not an array");

            int length;

            if (equality.TypeEquals(firstArray.GetType().GetElementType(), otherArray.GetType().GetElementType()) && (length = Array.getLength(firstArray)) == Array.getLength(otherArray))
            {
                for (int i = 0; i < length; i++)
                {
                    if (!equality.ItemEquals(Array.get(firstArray, i), Array.get(otherArray, i)))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            return(false);
        }
Beispiel #2
0
 public void Setup()
 {
     _arrayEquality = JsonOptions.DefaultArrayEquality;
     JsonOptions.DefaultArrayEquality = ArrayEquality.ContentsEqual;
 }