We have to test the printStatement method in Account
authorGustavo Martin Morcuende <gustavo.martin@scmspain.com>
Sun, 4 Dec 2016 16:21:38 +0000 (17:21 +0100)
committerGustavo Martin Morcuende <gustavo.martin@scmspain.com>
Sun, 4 Dec 2016 16:21:38 +0000 (17:21 +0100)
TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/StatementPrinter.java [new file with mode: 0644]
TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Transaction.java [new file with mode: 0644]
TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.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 (file)
index 0000000..d09be2f
--- /dev/null
@@ -0,0 +1,11 @@
+package org.craftedsw.feature;
+
+import java.util.List;
+
+public class StatementPrinter {
+
+       public void print(List<Transaction> 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 (file)
index 0000000..69e932f
--- /dev/null
@@ -0,0 +1,5 @@
+package org.craftedsw.feature;
+
+public class Transaction {
+
+}
index 07d0c32..e5d4139 100644 (file)
@@ -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<Transaction> transactions = null;
+               
+               verify(statementPrinter).print(transactions);
+       }
+ }