示例#1
0
 private ArrayListUpdateTestCase.Item CreateItem(Type clazz)
 {
     ArrayListUpdateTestCase.Item item = new ArrayListUpdateTestCase.Item();
     item._listClassName = clazz.FullName;
     CreateLists(item, clazz);
     return(item);
 }
示例#2
0
 private void CreateLists(ArrayListUpdateTestCase.Item item, Type clazz)
 {
     item._typed          = (ArrayList)CreateFilledList(clazz);
     item._untyped        = CreateFilledList(clazz);
     item._interface      = CreateFilledList(clazz);
     item._emptyTyped     = (ArrayList)CreateList(clazz);
     item._emptyUntyped   = CreateList(clazz);
     item._emptyInterface = CreateList(clazz);
 }
示例#3
0
 private void AssertItem(object obj, Type clazz)
 {
     ArrayListUpdateTestCase.Item item = (ArrayListUpdateTestCase.Item)obj;
     AssertList(item._typed, clazz);
     AssertList(item._untyped, clazz);
     AssertList(item._interface, clazz);
     AssertEmptyList(item._emptyTyped);
     AssertEmptyList(item._emptyUntyped);
     AssertEmptyList(item._emptyInterface);
 }
示例#4
0
 protected override object[] CreateValues()
 {
     if (TestNotCompatibleToOldVersion())
     {
         return(new ArrayListUpdateTestCase.Item[0]);
     }
     ArrayListUpdateTestCase.Item[] values = new ArrayListUpdateTestCase.Item[3];
     values[0] = CreateItem(typeof(ArrayList));
     values[1] = CreateItem(typeof(ArrayListUpdateTestCase.ArrayListExtensionWithField
                                   ));
     values[2] = CreateItem(typeof(ArrayListUpdateTestCase.ArrayListExtensionWithoutField
                                   ));
     return(values);
 }
示例#5
0
        //        assertQuery(objectContainer, clazz, "_untyped");
        //        assertQuery(objectContainer, clazz, "_interface");
        private void AssertQuery(IExtObjectContainer objectContainer, Type clazz, string
                                 fieldName)
        {
            IQuery q = objectContainer.Query();

            q.Constrain(typeof(ArrayListUpdateTestCase.Item));
            q.Descend("_listClassName").Constrain(clazz.FullName);
            q.Descend(fieldName).Constrain("one");
            IObjectSet objectSet = q.Execute();

            Assert.AreEqual(1, objectSet.Count);
            ArrayListUpdateTestCase.Item item = (ArrayListUpdateTestCase.Item)objectSet.Next(
                );
            AssertItem(item, clazz);
        }
		private ArrayListUpdateTestCase.Item CreateItem(Type clazz)
		{
			ArrayListUpdateTestCase.Item item = new ArrayListUpdateTestCase.Item();
			item._listClassName = clazz.FullName;
			CreateLists(item, clazz);
			return item;
		}
		protected override object[] CreateValues()
		{
			if (TestNotCompatibleToOldVersion())
			{
				return new ArrayListUpdateTestCase.Item[0];
			}
			ArrayListUpdateTestCase.Item[] values = new ArrayListUpdateTestCase.Item[3];
			values[0] = CreateItem(typeof(ArrayList));
			values[1] = CreateItem(typeof(ArrayListUpdateTestCase.ArrayListExtensionWithField
				));
			values[2] = CreateItem(typeof(ArrayListUpdateTestCase.ArrayListExtensionWithoutField
				));
			return values;
		}