change test class name, add blank line and swap assert method parameter

This commit is contained in:
STS 2020-07-26 20:01:42 +02:00
parent 9b7caf3118
commit 48ea32d583
1 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class ExcelFormulaUnitTest {
}
@Test
void givenExcelData_whenSetAndEvaluateFormula() throws IOException {
void givenExcelData_whenSetFormula_thenSuccess() throws IOException {
FileInputStream inputStream = new FileInputStream(new File(fileLocation));
XSSFWorkbook wb = new XSSFWorkbook(inputStream);
XSSFSheet sheet = wb.getSheetAt(0);
@ -43,7 +43,9 @@ class ExcelFormulaUnitTest {
String startCellB = colNameB + 1;
String stopCellB = colNameB + (sheet.getLastRowNum() + 1);
String sumFormulaForColumnB = String.format("SUM(%s:%s)", startCellB, stopCellB);
double resultValue = excelFormula.setFormula(fileLocation, wb, sumFormulaForColumnA + "-" + sumFormulaForColumnB);
Assert.assertEquals(resultValue, resultColumnA - resultColumnB, 0d);
Assert.assertEquals(resultColumnA - resultColumnB, resultValue, 0d);
}
}