///////////////////// // UTILITY METHODS // ///////////////////// private void checkType(XType type, params Field[] fields) { Assert.IsNotNull(type); Assert.AreSame(typeof(XType), type.GetType()); Assert.AreSame(type, vf.GetType(type.Id)); List <Field> tfields = type.GetFields(); if (fields != null) { Assert.AreEqual(fields.Length, tfields.Count); //for (Field f: fields) for (int i = 0; i < fields.Length; i++) { Assert.IsNotNull(type.GetValidator(fields[i])); Assert.AreSame(fields[i], type.GetField(fields[i].Id)); Assert.AreSame(fields[i], type.GetField(fields[i].Name)); } } else { Assert.AreEqual(0, tfields.Count); } }