예제 #1
0
        private void tryFormat(int row, String expectedText, String desc,
                               CellValue Getter, ICell cell)
        {
            Object value     = Getter.GetValue(cell);
            Color  testColor = Getter.GetColor(cell);

            if (testColor == null)
            {
                testColor = TEST_COLOR;
            }

            if (label == null)
            {
                label = new Label();
            }
            label.ForeColor = (/*setter*/ testColor);
            label.Text      = (/*setter*/ "xyzzy");

            logger.Log(POILogger.INFO, String.Format("Row %d: \"%s\" -> \"%s\": expected \"%s\"", row + 1,
                                                     value.ToString(), desc, expectedText));
            String actualText = tryColor(desc, null, Getter, value, expectedText,
                                         testColor);

            logger.Log(POILogger.INFO, String.Format(", actual \"%s\")%n", actualText));

            if (tryAllColors && testColor != TEST_COLOR)
            {
                for (int i = 0; i < COLOR_NAMES.Length; i++)
                {
                    String cname = COLOR_NAMES[i];
                    tryColor(desc, cname, Getter, value, expectedText, COLORS[i]);
                }
            }
        }