forked from hummel/Bank-System
„Bank-Beispiel/src/de/hs_mannheim/informatik/bank/facade/SystemTest.java“ löschen
parent
0aa191eeef
commit
1dd2d13598
|
@ -1,59 +0,0 @@
|
||||||
package de.hs_mannheim.informatik.bank.facade;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.jupiter.api.AfterAll;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
class SystemTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void smokeTest() throws Exception {
|
|
||||||
Banksystem bs = new Banksystem("Testbanksystem");
|
|
||||||
|
|
||||||
assertNotNull(bs);
|
|
||||||
assertEquals(0, bs.getKontenliste().length);
|
|
||||||
assertEquals("Testbanksystem", bs.getBankname());
|
|
||||||
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
void auszahlenTest() throws Exception {
|
|
||||||
Banksystem bs = new Banksystem("Testsystem");
|
|
||||||
|
|
||||||
int kn1=bs.kontoAnlegen("Marc", 1);
|
|
||||||
int kn2=bs.kontoAnlegen("Marc", 2);
|
|
||||||
int kn3=bs.kontoAnlegen("Marc", 1);
|
|
||||||
|
|
||||||
assertEquals(1000,bs.geldEinzahlen(kn1, 1000));
|
|
||||||
assertEquals(500,bs.geldEinzahlen(kn2, 500));
|
|
||||||
assertEquals(0,bs.geldEinzahlen(kn3, 0));
|
|
||||||
|
|
||||||
assertEquals(true,bs.geldAuszahlen(kn1, 666));
|
|
||||||
assertEquals(true,bs.geldAuszahlen(kn2, 999));
|
|
||||||
assertEquals(false,bs.geldAuszahlen(kn3, 1000));
|
|
||||||
|
|
||||||
assertEquals(89501,bs.geldEinzahlen(kn2, 90000));
|
|
||||||
|
|
||||||
int kn4=bs.kontoAnlegen("Marc", 2);
|
|
||||||
assertEquals(true,bs.ÜberweisungBeauftragen(kn2, kn4, 50000, "Spielschulden"));
|
|
||||||
assertEquals(false,bs.ÜberweisungBeauftragen(kn1, kn2, 1000, "Test"));
|
|
||||||
assertEquals(false,bs.ÜberweisungBeauftragen(kn2, kn3, 1000, "Test"));
|
|
||||||
|
|
||||||
assertEquals(true,bs.ÜberweisungBeauftragen(kn4, kn2, 50500, "test"));
|
|
||||||
|
|
||||||
//File fp=new File("C:\\Users\\Marc Ziegler\\git\\Bank-System_2121847\\Bank-Beispiel\\Testsystem-bank-data.ser");
|
|
||||||
//File fp=new File("Testsystem-bank-data.ser");
|
|
||||||
File fp=new File("C:/Users/Marc Ziegler/git/Bank-System_2121847/Bank-Beispiel/Testsystem-bank-data.ser");
|
|
||||||
fp.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue