Permalink
Browse files

Inner loop - Red: Test repository store transactions

  • Loading branch information...
CarlosMChica committed May 2, 2016
1 parent dd1a92a commit f1585c33ae99ed2daa3aec6a6b9b9e999e8e391e
@@ -4,10 +4,9 @@
public class TransactionRepository {
public void store(Transaction transaction) {
throw new UnsupportedOperationException();
}
public List<Transaction> transactions() {
throw new UnsupportedOperationException();
return null;
}
}
@@ -0,0 +1,27 @@
package me.panavtec.androidbankkata.account.transaction;
import java.util.Date;
import org.junit.Test;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.junit.Assert.assertThat;
public class TransactionRepositoryShouldShould {
@Test public void store_transactions() {
TransactionRepository repository = new TransactionRepository();
Deposit deposit = new Deposit(anAmount(), aDate());
repository.store(deposit);
assertThat(repository.transactions(), hasItem(deposit));
}
private Date aDate() {
return null;
}
private int anAmount() {
return 0;
}
}

0 comments on commit f1585c3

Please sign in to comment.