{
@Test
@DisplayName("A new sum can be started, if it does not exist")
- public void testCanStartSumIfNotExists()
+ public void testStartSumPossibleIfNotExists()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
assertThatNoException().isThrownBy(() -> adder.startSum("foo"));
@Test
@DisplayName("An empty Optional should be returned, for a non-existing sum")
- public void testEmptyOptionalForNonExistingSum()
+ public void testGetSumReturnsEmptyOptionalForNonExistingSum()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
assertThat(adder.getSum("foo")).isEmpty();
@Test
@DisplayName("A non-empty Optional should be returned, for an existing sum")
- public void testNonEmptyOptionalForExistingSum()
+ public void testGetSumReturnsNonEmptyOptionalForExistingSum()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
adder.startSum("foo");
@Test
@DisplayName("A sum can be ended, if it does exist")
- public void testCanEndIfSumExists()
+ public void testEndSumPossibleIfSumExists()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
adder.startSum("foo");
@Test
@DisplayName("Adding a null-value to an existing sum causes an IllegalArgumentException")
- public void testAddNullToExistingSumCausesException()
+ public void testAddSumWithNullValueToExistingSumCausesException()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
adder.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)
{
AdderBusinessLogic adder = new AdderBusinessLogic();
adder.startSum("foo");
@Test
@DisplayName("Can add a positive value to an existing sum")
- public void testCanAddPositiveValueToExistingSum()
+ public void testAddSumWithPositiveValuePossibleIfSumExists()
{
AdderBusinessLogic adder = new AdderBusinessLogic();
adder.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();
AdderBusinessLogic adder = new AdderBusinessLogic();