„Bank-Beispiel/src/de/hs_mannheim/informatik/bank/domain/KontoTest.java“ löschen
parent
5f46231b20
commit
f8dc004643
|
@ -1,69 +0,0 @@
|
||||||
package de.hs_mannheim.informatik.bank.domain;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
class KontoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testKontoBasics() {
|
|
||||||
Konto k = new Konto("Müller", 0);
|
|
||||||
assertEquals("Müller", k.getInhaber());
|
|
||||||
assertEquals(1000, k.getKontonummer());
|
|
||||||
assertEquals(0, k.getKontostand());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testKontoEinUndAuszahlung() {
|
|
||||||
Konto k = new Konto("Müller", 0);
|
|
||||||
Konto k2 = new Konto("Mayer", 1);
|
|
||||||
|
|
||||||
assertEquals("Mayer", k2.getInhaber());
|
|
||||||
assertNotEquals(k.getKontonummer(), k2.getKontonummer());
|
|
||||||
|
|
||||||
k2.einzahlen(100, "Test", "Einzahlung", "JUnit");
|
|
||||||
assertEquals(100, k2.getKontostand());
|
|
||||||
|
|
||||||
assertTrue(k2.auszahlen(50, "Test", "Auszahlung", "JUnit"));
|
|
||||||
assertEquals(50, k2.getKontostand());
|
|
||||||
|
|
||||||
assertFalse(k2.auszahlen(500, "Test", "Auszahlung", "JUnit"));
|
|
||||||
assertEquals(50, k2.getKontostand());
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
void testGiroDespo(){
|
|
||||||
Girokonto Gk1=new Girokonto("Marc",0);
|
|
||||||
Girokonto Gk2=new Girokonto("Marc",1);
|
|
||||||
|
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
|
||||||
Gk2.einzahlen(50000, "Test", "vorOrt", "ich");
|
|
||||||
|
|
||||||
assertEquals(true,Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich"));
|
|
||||||
assertEquals(true,Gk2.auszahlen(10000, "none of youre buisness", "vor Ort", "Ich"));
|
|
||||||
assertEquals(false,Gk1.Überweise(Gk2, 40500, "weil ich es kann"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testSaldo() {
|
|
||||||
Girokonto Gk1=new Girokonto("Marc",0);
|
|
||||||
|
|
||||||
Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
|
||||||
|
|
||||||
|
|
||||||
assertEquals(42500,Gk1.getSaldo());
|
|
||||||
assertEquals(87000,Gk1.getKontostand());
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue