From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 16:21:38 +0000 (+0100) Subject: We have to test the printStatement method in Account X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=b3b3d4c8aec91687bfe1307af79e173e63974f23;p=JavaForFun We have to test the printStatement method in Account --- diff --git a/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/StatementPrinter.java b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/StatementPrinter.java new file mode 100644 index 0000000..d09be2f --- /dev/null +++ b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/StatementPrinter.java @@ -0,0 +1,11 @@ +package org.craftedsw.feature; + +import java.util.List; + +public class StatementPrinter { + + public void print(List transactions) { + throw new UnsupportedOperationException(); + } + +} diff --git a/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Transaction.java b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Transaction.java new file mode 100644 index 0000000..69e932f --- /dev/null +++ b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Transaction.java @@ -0,0 +1,5 @@ +package org.craftedsw.feature; + +public class Transaction { + +} diff --git a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java index 07d0c32..e5d4139 100644 --- a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java @@ -2,6 +2,8 @@ package org.craftedsw.feature; import static org.mockito.Mockito.verify; +import java.util.List; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,6 +15,7 @@ public class AccountShould { @Mock private TransactionRepository transactionRepository; private Account account; + private StatementPrinter statementPrinter; @Before public void initialise() { @@ -32,4 +35,11 @@ public class AccountShould { verify(transactionRepository).addWithdrawal(100); } -} + + @Test public void + print_a_statement() { + List transactions = null; + + verify(statementPrinter).print(transactions); + } + }