Exemple #1
0
        public void GetRowItemListTest()
        {
            RectMatrix <int> matrix = new RectMatrix <int>();

            matrix.EnsureSize(4, 2);
            matrix[0, 0] = 5;
            matrix[0, 1] = 7;
            matrix[1, 0] = 1;
            matrix[1, 1] = 9;
            matrix[2, 0] = -2;
            matrix[2, 1] = 3;
            matrix[3, 0] = 5;
            matrix[3, 1] = 2;
            CollectionAssert.AreEqual(new int[] { 5, 7 }, matrix.GetRowItemList(0));
            CollectionAssert.AreEqual(new int[] { 1, 9 }, matrix.GetRowItemList(1));
            CollectionAssert.AreEqual(new int[] { -2, 3 }, matrix.GetRowItemList(2));
            CollectionAssert.AreEqual(new int[] { 5, 2 }, matrix.GetRowItemList(3));
        }
Exemple #2
0
        public void GetRowItemListGuardCase1Test()
        {
            RectMatrix <int> matrix = new RectMatrix <int>();

            matrix.EnsureSize(4, 2);
            matrix[0, 0] = 5;
            matrix[0, 1] = 7;
            matrix[1, 0] = 1;
            matrix[1, 1] = 9;
            matrix[2, 0] = -2;
            matrix[2, 1] = 3;
            matrix[3, 0] = 5;
            matrix[3, 1] = 2;
            var result = matrix.GetRowItemList(-100);
        }