public void TestGetSetPatternType() { CT_Fill ctFill = new CT_Fill(); XSSFCellFill cellFill = new XSSFCellFill(ctFill); CT_PatternFill ctPatternFill = ctFill.AddNewPatternFill(); ctPatternFill.patternType = (ST_PatternType.solid); Assert.AreEqual(ST_PatternType.solid, cellFill.GetPatternType()); }
public void TestGetNotModifies() { CT_Fill ctFill = new CT_Fill(); XSSFCellFill cellFill = new XSSFCellFill(ctFill); CT_PatternFill ctPatternFill = ctFill.AddNewPatternFill(); ctPatternFill.patternType = (ST_PatternType.darkDown); Assert.AreEqual(ST_PatternType.darkDown, cellFill.GetPatternType()); }
public void TestGetFillForegroundColor() { CT_Fill ctFill = new CT_Fill(); XSSFCellFill cellFill = new XSSFCellFill(ctFill); CT_PatternFill ctPatternFill = ctFill.AddNewPatternFill(); CT_Color fgColor = ctPatternFill.AddNewFgColor(); Assert.IsNotNull(cellFill.GetFillForegroundColor()); fgColor.indexed = 8; fgColor.indexedSpecified = true; Assert.AreEqual(8, cellFill.GetFillForegroundColor().Indexed); }
public void SetUp() { stylesTable = new StylesTable(); ctStylesheet = stylesTable.GetCTStylesheet(); ctBorderA = new CT_Border(); XSSFCellBorder borderA = new XSSFCellBorder(ctBorderA); long borderId = stylesTable.PutBorder(borderA); Assert.AreEqual(1, borderId); XSSFCellBorder borderB = new XSSFCellBorder(); Assert.AreEqual(1, stylesTable.PutBorder(borderB)); ctFill = new CT_Fill(); XSSFCellFill fill = new XSSFCellFill(ctFill); long fillId = stylesTable.PutFill(fill); Assert.AreEqual(2, fillId); ctFont = new CT_Font(); XSSFFont font = new XSSFFont(ctFont); long fontId = stylesTable.PutFont(font); Assert.AreEqual(1, fontId); cellStyleXf = ctStylesheet.AddNewCellStyleXfs().AddNewXf(); cellStyleXf.borderId = 1; cellStyleXf.fillId = 1; cellStyleXf.fontId = 1; cellXfs = ctStylesheet.AddNewCellXfs(); cellXf = cellXfs.AddNewXf(); cellXf.xfId = (1); cellXf.borderId = (1); cellXf.fillId = (1); cellXf.fontId = (1); stylesTable.PutCellStyleXf(cellStyleXf); stylesTable.PutCellXf(cellXf); cellStyle = new XSSFCellStyle(1, 1, stylesTable, null); Assert.IsNotNull(stylesTable.GetFillAt(1).GetCTFill().patternFill); Assert.AreEqual(ST_PatternType.darkGray, stylesTable.GetFillAt(1).GetCTFill().patternFill.patternType); }
public int PutFill(XSSFCellFill fill) { int idx = fills.IndexOf(fill); if (idx != -1) { return idx; } fills.Add(fill); return fills.Count - 1; }