private static Array BuildAndVerifyArray(Type t, int length) { Array array = CollectionFactory.BuildArray(t, length); Assert.AreEqual(t.MakeArrayType(), array.GetType()); Assert.AreEqual(length, array.Length); if (length > 0) { object firstValue = array.GetValue(0); if (firstValue != null) { Assert.AreEqual(t, firstValue.GetType()); } } return(array); }