Пример #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;
		}