예제 #1
0
        private IList CreateFilledList(Type clazz)
        {
            IList list = CreateList(clazz);

            FillList(list);
            if (list is ArrayListUpdateTestCase.ArrayListExtensionWithField)
            {
                ArrayListUpdateTestCase.ArrayListExtensionWithField typedList = (ArrayListUpdateTestCase.ArrayListExtensionWithField
                                                                                 )list;
                typedList.name = ArrayListUpdateTestCase.ArrayListExtensionWithField.StoredName;
            }
            return(list);
        }
예제 #2
0
 public override bool Equals(object obj)
 {
     if (!base.Equals(obj))
     {
         return(false);
     }
     ArrayListUpdateTestCase.ArrayListExtensionWithField other = (ArrayListUpdateTestCase.ArrayListExtensionWithField
                                                                  )obj;
     if (name == null)
     {
         return(other.name == null);
     }
     return(name.Equals(other.name));
 }
예제 #3
0
        private void AssertList(object obj, Type clazz)
        {
            IList list = (IList)obj;

            object[]    array = new object[list.Count];
            int         idx   = 0;
            IEnumerator i     = list.GetEnumerator();

            while (i.MoveNext())
            {
                array[idx++] = i.Current;
            }
            ArrayAssert.AreEqual(Data, array);
            Assert.IsInstanceOf(clazz, list);
            if (list is ArrayListUpdateTestCase.ArrayListExtensionWithField)
            {
                ArrayListUpdateTestCase.ArrayListExtensionWithField typedList = (ArrayListUpdateTestCase.ArrayListExtensionWithField
                                                                                 )list;
                Assert.AreEqual(ArrayListUpdateTestCase.ArrayListExtensionWithField.StoredName, typedList
                                .name);
            }
        }