Skip to content

Commit

Permalink
green
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jun 10, 2013
1 parent 9c4de61 commit e609a04
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
Binary file modified BankAccountDay05/bin/main/BankAccount.class
Binary file not shown.
Binary file modified BankAccountDay05/bin/main/BankAccountDTO.class
Binary file not shown.
Binary file modified BankAccountDay05/bin/test/BankAccountTest.class
Binary file not shown.
16 changes: 13 additions & 3 deletions BankAccountDay05/src/main/BankAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@
*
*/
public class BankAccount {
private static BankAccountDAO mockBankAccountDAO;

public static void setBankAccountDAO(BankAccountDAO mockBankAccountDAO) {
// TODO Auto-generated method stub

BankAccount.mockBankAccountDAO = mockBankAccountDAO;
}

public static BankAccountDTO openAccount(String accountNumber) {
return null;
BankAccountDTO accountDTO = createAccount(accountNumber);
mockBankAccountDAO.save(accountDTO);
return accountDTO;
}

private static BankAccountDTO createAccount(String accountNumber) {
BankAccountDTO account = new BankAccountDTO();
account.setAccountNumber(accountNumber);
account.setBalance(0);
account.setOpenTimestampt("08/06/2013");
return account;
}

}
15 changes: 14 additions & 1 deletion BankAccountDay05/src/main/BankAccountDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BankAccountDTO {
private String accountNumber;
private float balance;
private String openTimestampt;

private String description;
/**
* @return the accountNumber
*/
Expand Down Expand Up @@ -57,4 +57,17 @@ public void setOpenTimestampt(String openTimestampt) {
this.openTimestampt = openTimestampt;
}

/**
* @return the description
*/
public String getDescription() {
return description;
}

/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
}
5 changes: 3 additions & 2 deletions BankAccountDay05/src/test/BankAccountTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static junit.framework.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import main.BankAccount;
import main.BankAccountDAO;
Expand All @@ -17,7 +18,7 @@

/**
* @author quynhlt
*
*
*/
public class BankAccountTest {

Expand All @@ -31,7 +32,7 @@ public void setUp() {

// Step 1 and 2
@Test
public void openAccountHasZeroBalanceAndIsPersistent() {
public void testOpenAccountHasZeroBalanceAndIsPersistent() {
String accountNumber = "1234567890";
BankAccount.openAccount(accountNumber);
ArgumentCaptor<BankAccountDTO> captorSaveAccount = ArgumentCaptor.forClass(BankAccountDTO.class);
Expand Down

0 comments on commit e609a04

Please sign in to comment.