generated from hummel/Bank-System
Unit -und Systemtests für Auszahlung hinzugefügt
parent
4cef95e571
commit
ea696be393
|
@ -12,4 +12,12 @@ class KontoTest {
|
||||||
k.kontoEinzahlen(k, 100);
|
k.kontoEinzahlen(k, 100);
|
||||||
assertEquals(150, k.kontoEinzahlen(k, 50));
|
assertEquals(150, k.kontoEinzahlen(k, 50));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void kontoAbhebenTest() {
|
||||||
|
Konto k = new Konto("User");
|
||||||
|
k.kontoEinzahlen(k, 100);
|
||||||
|
assertEquals(50, k.kontoAbheben(k, 50));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,20 @@ class BanksystemTest {
|
||||||
int kontonr = bs.kontoAnlegen("User2");
|
int kontonr = bs.kontoAnlegen("User2");
|
||||||
assertEquals("50.00", bs.kontoEinzahlen("50", kontonr));
|
assertEquals("50.00", bs.kontoEinzahlen("50", kontonr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void kontoAbhebenMitKommatest() {
|
||||||
|
Banksystem bs = new Banksystem("Testbank");
|
||||||
|
int kontonr = bs.kontoAnlegen("User");
|
||||||
|
bs.kontoEinzahlen("100", kontonr);
|
||||||
|
assertEquals("50.00", bs.kontoAbheben("50.00", kontonr));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void kontoAbhebenOhneKommatest() {
|
||||||
|
Banksystem bs = new Banksystem("Testbank2");
|
||||||
|
int kontonr = bs.kontoAnlegen("User2");
|
||||||
|
bs.kontoEinzahlen("100", kontonr);
|
||||||
|
assertEquals("50.00", bs.kontoAbheben("50", kontonr));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue