Example #1
0
        public void TranslateColumnAttributesGuardCase2Test()
        {
            RectMatrix <int, int> matrix = new RectMatrix <int, int>();

            matrix.EnsureSize(1, 1);
            matrix[0, 0]            = 0;
            matrix.RowAttributes[0] = matrix.ColumnAttributes[0] = 1;
            matrix.TranslateColumnAttributes((column, columnAttribute) => true, null);
        }
Example #2
0
        public void TranslateColumnAttributesGuardCase1Test()
        {
            RectMatrix <int, int> matrix = new RectMatrix <int, int>();

            matrix.EnsureSize(1, 1);
            matrix[0, 0]            = 0;
            matrix.RowAttributes[0] = matrix.ColumnAttributes[0] = 1;
            matrix.TranslateColumnAttributes(null, x => x);
        }
Example #3
0
        public void TranslateColumnAttributesTest()
        {
            RectMatrix <int, int> matrix = new RectMatrix <int, int>();

            matrix.EnsureSize(3, 2);
            matrix[0, 0]               = 1;
            matrix[0, 1]               = 1;
            matrix[1, 0]               = 1;
            matrix[1, 1]               = 1;
            matrix[2, 0]               = 1;
            matrix[2, 1]               = 1;
            matrix.RowAttributes[0]    = 1;
            matrix.RowAttributes[1]    = 2;
            matrix.RowAttributes[2]    = 3;
            matrix.ColumnAttributes[0] = 4;
            matrix.ColumnAttributes[1] = 10;
            matrix.TranslateColumnAttributes((column, columnAttribute) => columnAttribute > 5, x => x + 2);
            Assert.AreEqual(1, matrix.RowAttributes[0]);
            Assert.AreEqual(2, matrix.RowAttributes[1]);
            Assert.AreEqual(3, matrix.RowAttributes[2]);
            Assert.AreEqual(4, matrix.ColumnAttributes[0]);
            Assert.AreEqual(12, matrix.ColumnAttributes[1]);
        }