public bool CheckEquals(System.Reflection.MemberInfo rootType, ITester tester, object obj1, object obj2, string path, bool objectEqualsCheck) { var dic1 = (ME.ECS.Collections.IDictionaryULong)obj1; var dic2 = (ME.ECS.Collections.IDictionaryULong)obj2; if (dic1.Count != dic2.Count) { return(false); } foreach (var key in dic1.GetKeys()) { if (dic2.ContainsKey(key) == false) { return(false); } } foreach (var key in dic2.GetKeys()) { if (dic1.ContainsKey(key) == false) { return(false); } } var list = new System.Collections.Generic.List <object>(); foreach (var val1 in dic1) { list.Add(val1); } var i = 0; foreach (var val2 in dic2) { if (tester.IsInstanceEquals(rootType, list[i], val2, path, objectEqualsCheck) == false) { return(false); } ++i; } return(true); }
public bool CheckEquals(System.Reflection.MemberInfo rootType, ITester tester, object obj1, object obj2, string path, bool objectEqualsCheck) { var dic1 = (System.Collections.IList)obj1; var dic2 = (System.Collections.IList)obj2; if (dic1.Count != dic2.Count) { return(false); } for (int i = 0; i < dic1.Count; ++i) { if (tester.IsInstanceEquals(rootType, dic1[i], dic2[i], path, objectEqualsCheck) == false) { return(false); } } return(true); }
public bool CheckEquals(System.Reflection.MemberInfo rootType, ITester tester, object obj1, object obj2, string path, bool objectEqualsCheck) { var dic1 = (System.Array)obj1; var dic2 = (System.Array)obj2; if (dic1.Length != dic2.Length) { return(false); } for (int i = 0; i < dic1.Length; ++i) { if (tester.IsInstanceEquals(rootType, dic1.GetValue(i), dic2.GetValue(i), path, objectEqualsCheck) == false) { return(false); } } return(true); }
public bool CheckEquals(System.Reflection.MemberInfo rootType, ITester tester, object obj1, object obj2, string path, bool objectEqualsCheck) { var dic1 = (System.Collections.IEnumerable)obj1; var dic2 = (System.Collections.IEnumerable)obj2; var list1 = new System.Collections.Generic.List <object>(); var cnt1 = 0; foreach (var item in dic1) { ++cnt1; list1.Add(item); } var list2 = new System.Collections.Generic.List <object>(); var cnt2 = 0; foreach (var item in dic2) { ++cnt2; list2.Add(item); } if (cnt1 != cnt2) { return(false); } for (int i = 0; i < list1.Count; ++i) { if (tester.IsInstanceEquals(rootType, list1[i], list2[i], path, objectEqualsCheck) == false) { return(false); } } return(true); }
public bool CheckEquals(System.Reflection.MemberInfo rootType, ITester tester, object obj1, object obj2, string path, bool objectEqualsCheck) { var dic1 = (ME.ECS.Collections.IBufferArray)obj1; var dic2 = (ME.ECS.Collections.IBufferArray)obj2; if (dic1.Count != dic2.Count) { return(false); } var arr1 = dic1.GetArray(); var arr2 = dic2.GetArray(); if (arr1 == null && arr2 == null) { return(true); } if (arr1 != null && arr2 == null) { return(false); } if (arr1 == null && arr2 != null) { return(false); } for (int i = 0; i < arr1.Length; ++i) { if (tester.IsInstanceEquals(rootType, arr1.GetValue(i), arr2.GetValue(i), path, objectEqualsCheck) == false) { return(false); } } return(true); }