Esempio n. 1
0
        public void GetColumnItemListTest()
        {
            RectMatrix <int> matrix = new RectMatrix <int>();

            matrix.EnsureSize(2, 4);
            matrix[0, 0] = 11;
            matrix[0, 1] = 5;
            matrix[0, 2] = -7;
            matrix[0, 3] = 6;
            matrix[1, 0] = 3;
            matrix[1, 1] = 0;
            matrix[1, 2] = -7;
            matrix[1, 3] = 2;
            CollectionAssert.AreEqual(new int[] { 11, 3 }, matrix.GetColumnItemList(0));
            CollectionAssert.AreEqual(new int[] { 5, 0 }, matrix.GetColumnItemList(1));
            CollectionAssert.AreEqual(new int[] { -7, -7 }, matrix.GetColumnItemList(2));
            CollectionAssert.AreEqual(new int[] { 6, 2 }, matrix.GetColumnItemList(3));
        }
Esempio n. 2
0
        public void GetColumnItemListGuardCase3Test()
        {
            RectMatrix <int> matrix = new RectMatrix <int>();

            matrix.EnsureSize(2, 4);
            matrix[0, 0] = 11;
            matrix[0, 1] = 5;
            matrix[0, 2] = -7;
            matrix[0, 3] = 6;
            matrix[1, 0] = 3;
            matrix[1, 1] = 0;
            matrix[1, 2] = -7;
            matrix[1, 3] = 2;
            var result = matrix.GetColumnItemList(4);
        }