From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 17:35:51 +0000 (+0100) Subject: Removing duplications from TransactionRepositoryShould X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=97c8ca3ba13963863f7a3b2acde208853582648f;p=JavaForFun Removing duplications from TransactionRepositoryShould --- diff --git a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepositoryShould.java b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepositoryShould.java index 0b1e214..7b55677 100644 --- a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepositoryShould.java +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepositoryShould.java @@ -27,11 +27,11 @@ public class TransactionRepositoryShould { @Before public void initialise() { transactionRepository = new TransactionRepository(clock); + given(clock.todayAsString()).willReturn(TODAY); } @Test public void create_and_store_a_deposit_transaction() { - given(clock.todayAsString()).willReturn(TODAY); transactionRepository.addDeposit(100); List transactions = transactionRepository.allTransactions(); @@ -42,7 +42,6 @@ public class TransactionRepositoryShould { @Test public void create_and_store_a_withdrawal_transaction() { - given(clock.todayAsString()).willReturn(TODAY); transactionRepository.addWithdrawal(100); List transactions = transactionRepository.allTransactions();