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