package test;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import bank.KBBank;
import client.Client;

public class testClient {

	@Test
	public void testClient1(){
		Client cl = new Client("hanul");
		cl.selectBank(new KBBank());
		cl.openAccount();
		
		assertEquals(2000000, cl.getAsset());
		
		cl.deposit(50000);
		assertEquals(50000, cl.getBalance());
		assertEquals(1950000, cl.getAsset());
		
		cl.withdraw(10000);
		assertEquals(40000, cl.getBalance());
		assertEquals(1960000, cl.getAsset());
		
		cl.loan(20000);
		assertEquals(20000, cl.getDebt());
		assertEquals(1980000, cl.getAsset());
		
		cl.repay(10000);
		assertEquals(10000, cl.getDebt());
		assertEquals(1970000, cl.getAsset());
		
		cl.repayOnAccount(10000);
		assertEquals(0, cl.getDebt());
		assertEquals(30000, cl.getBalance());
		
		assertEquals("hanul", cl.getName());
	}
	
}

@@ -74,24 +74,42 @@
 unit.Test;%0A%0A
+import bank.Bank;%0A
 import bank.
@@ -242,22 +242,20 @@
 ;%0A%09%09
-cl.selectBank(
+Bank bank = 
 new 
@@ -262,17 +262,16 @@
 KBBank()
-)
 ;%0A%09%09cl.o
@@ -281,16 +281,20 @@
 Account(
+bank
 );%0A%09%09%0A%09%09
@@ -347,16 +347,22 @@
 deposit(
+bank, 
 50000);%0A
@@ -389,32 +389,36 @@
 , cl.getBalance(
+bank
 ));%0A%09%09assertEqua
@@ -462,16 +462,22 @@
 ithdraw(
+bank, 
 10000);%0A
@@ -508,24 +508,28 @@
 .getBalance(
+bank
 ));%0A%09%09assert
@@ -573,16 +573,22 @@
 cl.loan(
+bank, 
 20000);%0A
@@ -612,32 +612,36 @@
 000, cl.getDebt(
+bank
 ));%0A%09%09assertEqua
@@ -682,16 +682,22 @@
 l.repay(
+bank, 
 10000);%0A
@@ -721,32 +721,36 @@
 000, cl.getDebt(
+bank
 ));%0A%09%09assertEqua
@@ -800,16 +800,22 @@
 Account(
+bank, 
 10000);%0A
@@ -843,16 +843,20 @@
 getDebt(
+bank
 ));%0A%09%09as
@@ -887,16 +887,20 @@
 Balance(
+bank
 ));%0A%09%09%0A%09

change testfile