Skip to content

Commit 1700cba

Browse files
STSSTS
authored andcommitted
change test class name, add blank line and swap assert method parameter
1 parent e13f2c8 commit 1700cba

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apache-poi/src/test/java/com/baeldung/poi/excel/setformula/ExcelFormulaUnitTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void setup() throws URISyntaxException {
2525
}
2626

2727
@Test
28-
void givenExcelData_whenSetAndEvaluateFormula() throws IOException {
28+
void givenExcelData_whenSetFormula_thenSuccess() throws IOException {
2929
FileInputStream inputStream = new FileInputStream(new File(fileLocation));
3030
XSSFWorkbook wb = new XSSFWorkbook(inputStream);
3131
XSSFSheet sheet = wb.getSheetAt(0);
@@ -43,7 +43,9 @@ void givenExcelData_whenSetAndEvaluateFormula() throws IOException {
4343
String startCellB = colNameB + 1;
4444
String stopCellB = colNameB + (sheet.getLastRowNum() + 1);
4545
String sumFormulaForColumnB = String.format("SUM(%s:%s)", startCellB, stopCellB);
46+
4647
double resultValue = excelFormula.setFormula(fileLocation, wb, sumFormulaForColumnA + "-" + sumFormulaForColumnB);
47-
Assert.assertEquals(resultValue, resultColumnA - resultColumnB, 0d);
48+
49+
Assert.assertEquals(resultColumnA - resultColumnB, resultValue, 0d);
4850
}
4951
}

0 commit comments

Comments
 (0)