Verbesserungen
parent
dbe480be32
commit
adf7075e5a
|
@ -34,10 +34,10 @@ public class Girokonto extends Konto implements Serializable {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean auszahlen(long betrag, String zweck, String art, String auftraggeber) {
|
public boolean auszahlen(long betrag, String zweck, String art, String auftraggeber) {
|
||||||
if (this.getKontostand() - betrag >= -Dispo) {
|
if (super.stand - betrag >= -Dispo) {
|
||||||
this.setStand(getKontostand()-betrag);
|
super.stand-=betrag;
|
||||||
|
|
||||||
addkontoBewegung(betrag*-1, zweck, art, auftraggeber);
|
super.addkontoBewegung(betrag*-1, zweck, art, auftraggeber);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public class Konto implements Serializable {
|
public class Konto implements Serializable {
|
||||||
private int nummer;
|
private int nummer;
|
||||||
private long stand = 0;
|
protected long stand = 0;
|
||||||
private String inhaber;
|
private String inhaber;
|
||||||
private long Saldo=0;
|
private long Saldo=0;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@ class KontoTest {
|
||||||
void testSaldo() {
|
void testSaldo() {
|
||||||
Girokonto Gk1=new Girokonto("Marc",0);
|
Girokonto Gk1=new Girokonto("Marc",0);
|
||||||
|
|
||||||
//Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
||||||
|
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
||||||
Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
Gk1.einzahlen(50000, "Test", "vorOrt", "ich");
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
||||||
|
@ -59,10 +60,10 @@ class KontoTest {
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
||||||
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
||||||
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
Gk1.einzahlen(5000, "Test", "vorOrt", "ich");
|
||||||
//Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
Gk1.auszahlen(5500, "none of youre buisness", "vor Ort", "Ich");
|
||||||
|
|
||||||
|
|
||||||
assertEquals(42500,Gk1.getSaldo());
|
assertEquals(42500,Gk1.getSaldo());
|
||||||
assertEquals(42500,Gk1.getKontostand());
|
assertEquals(87000,Gk1.getKontostand());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue