forked from hummel/Bank-System
SystemTest
parent
5342607f66
commit
001cf34035
|
@ -19,42 +19,31 @@ class SystemTest {
|
|||
assertEquals(0, bs.getKontenliste().length);
|
||||
assertEquals("Testsystem", bs.getBankname());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testgeldEinzahlen() {
|
||||
Konto k = new Konto("Müller", 0);
|
||||
|
||||
long gueltigMin = 0;
|
||||
k.einzahlen(gueltigMin,"Test", "Einzahlung", "JUnit");
|
||||
assertEquals(gueltigMin,k.getKontostand());
|
||||
|
||||
long gueltigMax = Long.MAX_VALUE;
|
||||
k.einzahlen(gueltigMax, "Test", "Einzahlung", "JUnit");
|
||||
assertEquals(gueltigMax, k.getKontostand());
|
||||
|
||||
long ungueltigMin = -1;
|
||||
k.einzahlen(ungueltigMin, "Test", "Einzahlung", "JUnit");
|
||||
assertNotEquals(ungueltigMin, k.getKontostand());
|
||||
//System.out.println(k1.getKontostand());
|
||||
|
||||
|
||||
long ungueltigMax = Long.MAX_VALUE+1;
|
||||
System.out.println(ungueltigMax);
|
||||
k.einzahlen(gueltigMax,"Test", "Einzahlung", "JUnit");
|
||||
assertNotEquals(ungueltigMax, k.getKontostand());
|
||||
|
||||
void testgeldeinzahlen() throws Exception {
|
||||
Konto k1 = new Konto("Müller",2);
|
||||
|
||||
Banksystem bs1 = new Banksystem("Spaßkasse");
|
||||
int kontonummer = bs1.kontoAnlegen("Müller", 2);
|
||||
bs1.geldEinzahlen(kontonummer, 3000);
|
||||
bs1.geldEinzahlen(1000, 3000);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void testgeldAuszahlen() throws Exception {
|
||||
Konto k2 = new Konto("Beck",2);
|
||||
|
||||
Banksystem bs2 = new Banksystem("Spaßkasse");
|
||||
int kontonummer = bs2.kontoAnlegen("Beck", 2);
|
||||
bs2.geldAuszahlen(kontonummer, -4000);
|
||||
bs2.geldAuszahlen(1000, -4000);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// @Test
|
||||
// void testgeldAuszahlen() throws Exception {
|
||||
// Konto k2 = new Konto("Beck",2);
|
||||
// Banksystem bs = new Banksystem("Spaßkasse");
|
||||
// bs.geldAuszahlen(1000, -4000);
|
||||
// assertEquals(1000,-4000,bs.geldAuszahlen(1000, -4000));
|
||||
// long gueltigMin = -50000000;
|
||||
// k2.auszahlen(gueltigMin,"Test", "Einzahlung", "Beck");
|
||||
// assertEquals(gueltigMin, k2.getKontostand());
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue