Add unit tests for new Name.isHidden method

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2020-04-19 15:40:37 +00:00
parent 248e85dbba
commit e9d0ddce93
2 changed files with 8 additions and 0 deletions

View File

@ -290,11 +290,15 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
assertEquals("NameB1", b1.getNameName()); assertEquals("NameB1", b1.getNameName());
assertEquals("Sheet1", b1.getSheetName()); assertEquals("Sheet1", b1.getSheetName());
assertEquals(-1, b1.getSheetIndex()); assertEquals(-1, b1.getSheetIndex());
assertEquals(false, b1.isDeleted());
assertEquals(false, b1.isHidden());
assertNotNull(b2); assertNotNull(b2);
assertEquals("NameB2", b2.getNameName()); assertEquals("NameB2", b2.getNameName());
assertEquals("Sheet1", b2.getSheetName()); assertEquals("Sheet1", b2.getSheetName());
assertEquals(-1, b2.getSheetIndex()); assertEquals(-1, b2.getSheetIndex());
assertEquals(false, b2.isDeleted());
assertEquals(false, b2.isHidden());
assertNotNull(sheet2); assertNotNull(sheet2);
assertEquals("NameSheet2", sheet2.getNameName()); assertEquals("NameSheet2", sheet2.getNameName());

View File

@ -150,11 +150,15 @@ public final class TestHSSFName extends BaseTestNamedRange {
String reference = namedRange1.getRefersToFormula(); String reference = namedRange1.getRefersToFormula();
assertEquals(sheetName+"!$A$1:$D$10", reference); assertEquals(sheetName+"!$A$1:$D$10", reference);
assertEquals(false, namedRange1.isDeleted());
assertEquals(false, namedRange1.isHidden());
HSSFName namedRange2 = wb.getNameAt(1); HSSFName namedRange2 = wb.getNameAt(1);
assertEquals(sheetName+"!$D$17:$G$27", namedRange2.getRefersToFormula()); assertEquals(sheetName+"!$D$17:$G$27", namedRange2.getRefersToFormula());
assertEquals("SecondNamedRange", namedRange2.getNameName()); assertEquals("SecondNamedRange", namedRange2.getNameName());
assertEquals(false, namedRange2.isDeleted());
assertEquals(false, namedRange2.isHidden());
wb.close(); wb.close();
} }