예제 #1
0
        private void TestTypeFields(XType type, params Field[] fields)
        {
            List <Field> aFields = type.GetFields();
            List <Field> eFields = MkFieldSet(fields);

            Assert.IsTrue(CompareFieldLists(eFields, aFields));
        }
예제 #2
0
        /////////////////////
        // 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);
            }
        }