mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-19 05:30:43 +00:00
Feedback from code reviews
This commit is contained in:
@ -191,6 +191,12 @@ class FormulaInterpreterTest
|
||||
|
||||
assertEquals("Yes", interpretFormula(vi, "IF(GT(${input.one},0),Yes,No)"));
|
||||
assertEquals("No", interpretFormula(vi, "IF(LT(${input.one},0),Yes,No)"));
|
||||
assertEquals("Yes", interpretFormula(vi, "IF(true,Yes,No)"));
|
||||
assertEquals("Yes", interpretFormula(vi, "IF(True,Yes,No)"));
|
||||
assertEquals("No", interpretFormula(vi, "IF(false,Yes,No)"));
|
||||
assertEquals("No", interpretFormula(vi, "IF(False,Yes,No)"));
|
||||
|
||||
assertThatThrownBy(() -> interpretFormula(vi, "IF(foo,Yes,No)")).hasRootCauseMessage("Could not evaluate string 'foo' as a boolean.");
|
||||
}
|
||||
|
||||
}
|
@ -423,7 +423,7 @@ public class GenerateReportActionTest
|
||||
.withDataSourceName("persons")
|
||||
.withType(ReportType.SUMMARY)
|
||||
.withPivotFields(List.of("lastName"))
|
||||
.withTotalRow(includeTotalRow)
|
||||
.withIncludeTotalRow(includeTotalRow)
|
||||
.withTitleFormat("Number of shoes - people born between %s and %s - pivot on LastName, sort by Quantity, Revenue DESC")
|
||||
.withTitleFields(List.of("${input.startDate}", "${input.endDate}"))
|
||||
.withOrderByFields(List.of(new QFilterOrderBy("shoeCount"), new QFilterOrderBy("sumPrice", false)))
|
||||
|
@ -174,7 +174,7 @@ class QMetaDataVariableInterpreterTest
|
||||
|
||||
assertEquals("bar", variableInterpreter.interpretForObject("${input.foo}"));
|
||||
assertEquals(new BigDecimal("3.50"), variableInterpreter.interpretForObject("${input.amount}"));
|
||||
assertEquals("${input.x}", variableInterpreter.interpretForObject("${input.x}"));
|
||||
assertNull(variableInterpreter.interpretForObject("${input.x}"));
|
||||
}
|
||||
|
||||
|
||||
@ -189,13 +189,13 @@ class QMetaDataVariableInterpreterTest
|
||||
variableInterpreter.addValueMap("input", Map.of("amount", new BigDecimal("3.50"), "x", "y"));
|
||||
variableInterpreter.addValueMap("others", Map.of("foo", "fu", "amount", new BigDecimal("1.75")));
|
||||
|
||||
assertEquals("${input.foo}", variableInterpreter.interpretForObject("${input.foo}"));
|
||||
assertNull(variableInterpreter.interpretForObject("${input.foo}"));
|
||||
assertEquals("fu", variableInterpreter.interpretForObject("${others.foo}"));
|
||||
assertEquals(new BigDecimal("3.50"), variableInterpreter.interpretForObject("${input.amount}"));
|
||||
assertEquals(new BigDecimal("1.75"), variableInterpreter.interpretForObject("${others.amount}"));
|
||||
assertEquals("y", variableInterpreter.interpretForObject("${input.x}"));
|
||||
assertEquals("${others.x}", variableInterpreter.interpretForObject("${others.x}"));
|
||||
assertEquals("${input.nil}", variableInterpreter.interpretForObject("${input.nil}"));
|
||||
assertNull(variableInterpreter.interpretForObject("${others.x}"));
|
||||
assertNull(variableInterpreter.interpretForObject("${input.nil}"));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user