|
|
@ -8,32 +8,42 @@ class MyTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testSetBudgetView() { |
|
|
|
assertEquals(MeinGui.budget + " €", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(MeinGui.budget + " ", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(MeinGui.budget + "€ ", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(MeinGui.budget + " € ", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(MeinGui.budget + " ", MeinGui.setBudgetView()); |
|
|
|
MeinGui.budget = 2000.; |
|
|
|
|
|
|
|
assertEquals(2000.0 + " €", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(2000 + " €", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(2000.0 + "€ ", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(2000 + " €", MeinGui.setBudgetView()); |
|
|
|
assertNotEquals(2000.0 + "€", MeinGui.setBudgetView()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
public void testSetExpensesView() { |
|
|
|
assertEquals(MeinGui.expenses - MeinGui.budget + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.expenses - MeinGui.budget, MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.expenses - MeinGui.budget + "€ " , MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.expenses - MeinGui.budget + " € " , MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.expenses - MeinGui.budget + "", MeinGui.setExpensesView()); |
|
|
|
|
|
|
|
public void testSetBalanceView() { |
|
|
|
|
|
|
|
MeinGui.budget = 2000.; |
|
|
|
MeinGui.expenses = 405.; |
|
|
|
|
|
|
|
assertEquals(1595.0 + " €", MeinGui.setBalanceView()); |
|
|
|
assertNotEquals(1595 + " €", MeinGui.setBalanceView()); |
|
|
|
assertNotEquals(1595 + "€ ", MeinGui.setBalanceView()); |
|
|
|
assertNotEquals(1595 + "€", MeinGui.setBalanceView()); |
|
|
|
assertNotEquals(null, MeinGui.setBalanceView()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
public void testSetBalanceView() { |
|
|
|
assertEquals(MeinGui.balance + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.balance, MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.balance + "€ " , MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.balance+ " € " , MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(MeinGui.balance*2 + " € ", MeinGui.setExpensesView()); |
|
|
|
|
|
|
|
|
|
|
|
public void testSetExpensesView() { |
|
|
|
|
|
|
|
MeinGui.expenses = 1234; |
|
|
|
assertEquals("-" + 1234.0 + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(1234.0 + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals(null, MeinGui.setBalanceView()); |
|
|
|
MeinGui.expenses = 4321.; |
|
|
|
assertEquals("-" + 4321.0 + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals("-" + 4321 + " €", MeinGui.setExpensesView()); |
|
|
|
assertNotEquals("-" + 4321.0 + "€", MeinGui.setExpensesView()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |