public static void CtorTest() { LinkedList_T_Tests <string> helper = new LinkedList_T_Tests <string>(new LinkedList <string>(), new string[0]); helper.InitialItems_Tests(); LinkedList_T_Tests <Person> helper2 = new LinkedList_T_Tests <Person>(new LinkedList <Person>(), new Person[0]); helper2.InitialItems_Tests(); }
public static void Ctor_IEnumerableTest() { int arraySize = 16; int[] intArray = new int[arraySize]; Person[] personArray = new Person[arraySize]; int printableCharIndex = 65; // ascii "A" for (int i = 0; i < arraySize; ++i) { intArray[i] = i; char asChar = (char)(printableCharIndex + i); personArray[i] = new Person(asChar.ToString(), i); } // Testing with value types LinkedList <int> intList = new LinkedList <int>(Clone(intArray)); LinkedList_T_Tests <int> helper = new LinkedList_T_Tests <int>(intList, intArray); helper.InitialItems_Tests(); intArray = new int[0]; intList = new LinkedList <int>(Clone(intArray)); helper = new LinkedList_T_Tests <int>(intList, intArray); helper.InitialItems_Tests(); intArray = new int[] { -3 }; intList = new LinkedList <int>(Clone(intArray)); helper = new LinkedList_T_Tests <int>(intList, intArray); helper.InitialItems_Tests(); // Testing with an reference type LinkedList <Person> personList = new LinkedList <Person>(Clone(personArray)); LinkedList_T_Tests <Person> helper2 = new LinkedList_T_Tests <Person>(personList, personArray); helper2.InitialItems_Tests(); personArray = new Person[0]; personList = new LinkedList <Person>(Clone(personArray)); helper2 = new LinkedList_T_Tests <Person>(personList, personArray); helper2.InitialItems_Tests(); personArray = new Person[] { new Person("Jack", 18) }; personList = new LinkedList <Person>(Clone(personArray)); helper2 = new LinkedList_T_Tests <Person>(personList, personArray); helper2.InitialItems_Tests(); }