public void GenericConvertTest() { string[] arr = new string[] { "1", "2", "3" }; Type elementType = typeof(int); int[] expected = new int[] { 1, 2, 3 }; int[] actual; actual = ArrayExt.Convert <int>(arr); AssertEx.AreEqual(expected, actual); }
public void StandardConvertTest() { string[] arr = new string[] { "1", "2", "3" }; Type elementType = typeof(int); int[] expected = new int[] { 1, 2, 3 }; int[] actual; actual = (int[])ArrayExt.Convert(arr, elementType); AssertEx.AreEqual(expected, actual); }