use of org.apache.poi.ss.usermodel.CellType in project poi by apache.
the class TestWorkbookEvaluator method testIFEqualsFormulaEvaluation_BlankCompareToZero.
@Test
public void testIFEqualsFormulaEvaluation_BlankCompareToZero() {
final String formula = "IF(A1=0, B1, C1)";
final CellType cellType = CellType.BLANK;
final String expectedFormula = "IF(A1=0,B1,C1)";
final double expectedValue = 2.0;
testIFEqualsFormulaEvaluation_eval(formula, cellType, expectedFormula, expectedValue);
}
use of org.apache.poi.ss.usermodel.CellType in project poi by apache.
the class TestWorkbookEvaluator method testIFEqualsFormulaEvaluation_Boolean.
@Ignore("Bug 58591: this test currently fails")
@Test
public void testIFEqualsFormulaEvaluation_Boolean() {
final String formula = "IF(A1=1, B1, C1)";
final CellType cellType = CellType.BOOLEAN;
final String expectedFormula = "IF(A1=1,B1,C1)";
final double expectedValue = 2.0;
testIFEqualsFormulaEvaluation_eval(formula, cellType, expectedFormula, expectedValue);
}
use of org.apache.poi.ss.usermodel.CellType in project poi by apache.
the class TestWorkbookEvaluator method testIFEqualsFormulaEvaluation_StringCoerceToNumeric.
@Test
public void testIFEqualsFormulaEvaluation_StringCoerceToNumeric() {
final String formula = "IF(A1+0=1, B1, C1)";
final CellType cellType = CellType.STRING;
final String expectedFormula = "IF(A1+0=1,B1,C1)";
final double expectedValue = 2.0;
testIFEqualsFormulaEvaluation_eval(formula, cellType, expectedFormula, expectedValue);
}
use of org.apache.poi.ss.usermodel.CellType in project poi by apache.
the class TestWorkbookEvaluator method testIFEqualsFormulaEvaluation_NumericLiteral.
@Test
public void testIFEqualsFormulaEvaluation_NumericLiteral() {
final String formula = "IF(A1=1, 2, 3)";
final CellType cellType = CellType.NUMERIC;
final String expectedFormula = "IF(A1=1,2,3)";
final double expectedValue = 2.0;
testIFEqualsFormulaEvaluation_eval(formula, cellType, expectedFormula, expectedValue);
}
use of org.apache.poi.ss.usermodel.CellType in project poi by apache.
the class TestWorkbookEvaluator method testIFEqualsFormulaEvaluation_BlankInverted.
@Ignore("Bug 58591: this test currently fails")
@Test
public void testIFEqualsFormulaEvaluation_BlankInverted() {
final String formula = "IF(NOT(A1)=1, B1, C1)";
final CellType cellType = CellType.BLANK;
final String expectedFormula = "IF(NOT(A1)=1,B1,C1)";
final double expectedValue = 2.0;
testIFEqualsFormulaEvaluation_eval(formula, cellType, expectedFormula, expectedValue);
}
Aggregations