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

            matrix.EnsureSize(1, 1);
            matrix[0, 0]            = 0;
            matrix.RowAttributes[0] = matrix.ColumnAttributes[0] = 1;
            matrix.TranslateRowAttributes(null, x => x);
        }
Exemple #2
0
        public void TranslateRowAttributesGuardCase2Test()
        {
            RectMatrix <int, int> matrix = new RectMatrix <int, int>();

            matrix.EnsureSize(1, 1);
            matrix[0, 0]            = 0;
            matrix.RowAttributes[0] = matrix.ColumnAttributes[0] = 1;
            matrix.TranslateRowAttributes((row, rowAttribute) => true, null);
        }
Exemple #3
0
        public void TranslateRowAttributesTest()
        {
            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.TranslateRowAttributes((row, rowAttribute) => rowAttribute > 1, x => x + 1);
            Assert.AreEqual(1, matrix.RowAttributes[0]);
            Assert.AreEqual(3, matrix.RowAttributes[1]);
            Assert.AreEqual(4, matrix.RowAttributes[2]);
            Assert.AreEqual(4, matrix.ColumnAttributes[0]);
            Assert.AreEqual(10, matrix.ColumnAttributes[1]);
        }