From bd45a3b915544e8bfd6253415d436ba81edcb520 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 14 Jul 2015 21:54:28 +0000 Subject: [PATCH] More CF colour tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1691094 13f79535-47bb-0310-9956-ffa450edef68 --- .../BaseTestConditionalFormatting.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java index 5ee58d4b48..a803fc83cd 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestConditionalFormatting.java @@ -594,10 +594,15 @@ public abstract class BaseTestConditionalFormatting extends TestCase { assertEquals(ComparisonOperator.GT, cr.getComparisonOperation()); assertEquals("0", cr.getFormula1()); assertEquals(null, cr.getFormula2()); - // TODO Should the colours be slightly different like this? + // When it matches: + // Sets the font colour to dark green + // Sets the background colour to lighter green + // TODO Should the colours be slightly different between formats? if (cr instanceof HSSFConditionalFormattingRule) { + assertColour("0:8080:0", cr.getFontFormatting().getFontColor()); assertColour("CCCC:FFFF:CCCC", cr.getPatternFormatting().getFillBackgroundColorColor()); } else { + assertColour("006100", cr.getFontFormatting().getFontColor()); assertColour("C6EFCE", cr.getPatternFormatting().getFillBackgroundColorColor()); } @@ -613,9 +618,17 @@ public abstract class BaseTestConditionalFormatting extends TestCase { assertEquals(ComparisonOperator.BETWEEN, cr.getComparisonOperation()); assertEquals("10", cr.getFormula1()); assertEquals("30", cr.getFormula2()); -// assertColourGreen(cr); -// assertColourRed(cr); - // TODO Colour checking + // When it matches: + // Sets the font colour to dark red + // Sets the background colour to lighter red + // TODO Should the colours be slightly different between formats? + if (cr instanceof HSSFConditionalFormattingRule) { + assertColour("8080:0:8080", cr.getFontFormatting().getFontColor()); + assertColour("FFFF:9999:CCCC", cr.getPatternFormatting().getFillBackgroundColorColor()); + } else { + assertColour("9C0006", cr.getFontFormatting().getFontColor()); + assertColour("FFC7CE", cr.getPatternFormatting().getFillBackgroundColorColor()); + } // Data Bars - Column E -- 2.39.5