{
@Test
@DisplayName("A new sum can be started, if it does not exist")
- public void testCanStartSumIfNotExists()
+ public void testStartSumPossibleIfNotExists()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
assertThatNoException().isThrownBy(() -> sumBusinessLogic.startSum("foo"));
@Test
@DisplayName("An empty Optional should be returned, for a non-existing sum")
- public void testEmptyOptionalForNonExistingSum()
+ public void testGetSumReturnsEmptyOptionalForNonExistingSum()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
assertThat(sumBusinessLogic.getSum("foo")).isEmpty();
@Test
@DisplayName("A non-empty Optional should be returned, for an existing sum")
- public void testNonEmptyOptionalForExistingSum()
+ public void testGetSumReturnsNonEmptyOptionalForExistingSum()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
sumBusinessLogic.startSum("foo");
@Test
@DisplayName("A sum can be ended, if it does exist")
- public void testCanEndIfSumExists()
+ public void testEndSumPossibleIfSumExists()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
sumBusinessLogic.startSum("foo");
@Test
@DisplayName("Adding a null-value to an existing sum causes an IllegalArgumentException")
- public void testAddNullToExistingSumCausesException()
+ public void testAddSumWithNullValueToExistingSumCausesException()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
sumBusinessLogic.startSum("foo");
@ParameterizedTest(name = "{index}: Adding {0}")
@DisplayName("Adding a non-positive value to an existing sum causes an IllegalArgumentException")
@ValueSource(ints = { 0, -1, -6, -66, Integer.MIN_VALUE })
- public void testAddingNonPositiveValueToExistingSumCausesException(int value)
+ public void testAddSumWithNonPositiveValueToExistingSumCausesException(int value)
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
sumBusinessLogic.startSum("foo");
@Test
@DisplayName("Can add a positive value to an existing sum")
- public void testCanAddPositiveValueToExistingSum()
+ public void testAddSumWithPositiveValuePossibleIfSumExists()
{
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
sumBusinessLogic.startSum("foo");
@ParameterizedTest(name = "{index}: Summing up {0}")
@DisplayName("Adds up numbers correctly")
@MethodSource("numbersProvider")
- public void testCanAddPositiveValueToExistingSum(int... numbers)
+ public void testAddSumAddsUpNumbersCorrectlyIfSumExists(int... numbers)
{
long expectedResult = Arrays.stream(numbers).sum();
SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();