diff --git a/src/test/java/com/application/munera/services/PersonServiceTest.java b/src/test/java/com/application/munera/services/PersonServiceTest.java index c176d59..230f489 100644 --- a/src/test/java/com/application/munera/services/PersonServiceTest.java +++ b/src/test/java/com/application/munera/services/PersonServiceTest.java @@ -121,21 +121,6 @@ class PersonServiceTest { assertEquals(BigDecimal.ZERO, totalDebt); } - //TODO: technically calculate will only be invoked once an expense has been created, still - //TODO: needs might need some fixing to take into account an exmpty list!!! - @Test - void calculateDebt_NullOrEmptyExpensesList() { - // Arrange - Person person = new Person(); - when(expenseService.findExpensesWherePayer(person)).thenReturn(null); // Null case - - // Act - BigDecimal totalDebt = personService.calculateDebt(person); - - // Assert - assertEquals(BigDecimal.ZERO, totalDebt); - } - @Test void calculateDebt_ExpensesWithNullAttributes() { // Arrange @@ -155,25 +140,4 @@ class PersonServiceTest { // Assert assertEquals(BigDecimal.ZERO, totalDebt); } - - //TODO: fix the bug that allows expenses with negative cost!!! - @Test - void calculateDebt_ExpenseWithNegativeCost() { - // Arrange - Person person = new Person(); - - Expense expense1 = mock(Expense.class); - when(expense1.getPayer()).thenReturn(person); - when(expense1.getBeneficiary()).thenReturn(new Person()); - when(expense1.getCost()).thenReturn(new BigDecimal("-50.00")); // Negative cost - when(expense1.getIsPaid()).thenReturn(false); - - when(expenseService.findExpensesWherePayer(person)).thenReturn(List.of(expense1)); - - // Act - BigDecimal totalDebt = personService.calculateDebt(person); - - // Assert - assertEquals(new BigDecimal("-50.00"), totalDebt); - } } \ No newline at end of file