forked from hummel/Bank-System
Extra Test für Banksystem
parent
001b696e35
commit
3d95b1432c
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Bank-System</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -94,4 +94,8 @@ public class Banksystem {
|
||||||
return konto.getSaldo();
|
return konto.getSaldo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Bank getBank() {
|
||||||
|
return bank;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
import de.hs_mannheim.informatik.bank.infrastructure.Persistenz;
|
import de.hs_mannheim.informatik.bank.infrastructure.Persistenz;
|
||||||
|
import de.hs_mannheim.informatik.bank.ui.*;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
@ -59,4 +60,29 @@ class SystemTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void saldoTest() throws Exception {
|
||||||
|
Banksystem bs = new Banksystem("Testsystem");
|
||||||
|
UI UI = new UI(bs);
|
||||||
|
|
||||||
|
bs.geldEinzahlen(bs.kontoAnlegen("Kai", 1), 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
bs.geldEinzahlen(1000, 100);
|
||||||
|
|
||||||
|
assertNotNull(bs.getBank().findeKonto(1000).getSaldo());
|
||||||
|
String[] saldo = bs.getBank().findeKonto(1000).getSaldo();
|
||||||
|
assertEquals("Kontostand: 1200", saldo[10]);
|
||||||
|
File file = new File("C:\\Users\\Kai\\git\\Bank-System\\Bank-Beispiel\\Testsystem-bank-data.ser");
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue