From b3b3d4c8aec91687bfe1307af79e173e63974f23 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 17:21:38 +0100 Subject: [PATCH] We have to test the printStatement method in Account --- .../main/java/org/craftedsw/feature/StatementPrinter.java | 11 +++++++++++ .../src/main/java/org/craftedsw/feature/Transaction.java | 5 +++++ .../src/test/java/org/craftedsw/feature/AccountShould.java | 12 +++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/StatementPrinter.java create mode 100644 TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Transaction.java 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); + } + } -- 2.1.4