Exemplo n.º 1
0
        public void TestEvaluateRefInsideWindow()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet    s  = wb.CreateSheet() as SXSSFSheet;

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();

            SXSSFCell c = s.CreateRow(0).CreateCell(0) as SXSSFCell;

            c.SetCellValue(1.5);

            c             = s.CreateRow(1).CreateCell(0) as SXSSFCell;
            c.CellFormula = (/*setter*/ "A1*2");

            Assert.AreEqual(0, (int)c.NumericCellValue);
            eval.EvaluateFormulaCell(c);
            Assert.AreEqual(3, (int)c.NumericCellValue);

            wb.Close();
        }
Exemplo n.º 2
0
 public void IfCellTypeIsNumericCellValueShouldReturnValue()
 {
     _objectToTest = new SXSSFCell(null, CellType.Formula);
     _objectToTest.SetCellValue(9);
     Assert.AreEqual(9, _objectToTest.NumericCellValue);
 }