Writing the asserts and the trigger for those asserts.
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 4 Dec 2016 14:59:05 +0000 (15:59 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 4 Dec 2016 22:29:19 +0000 (23:29 +0100)
TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Console.java [new file with mode: 0644]
TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java

diff --git a/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Console.java b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Console.java
new file mode 100644 (file)
index 0000000..64785e5
--- /dev/null
@@ -0,0 +1,9 @@
+package org.craftedsw.feature;
+
+public class Console {
+
+       public void printLine(String text) {
+               throw new UnsupportedOperationException();
+       }
+       
+}
index 0af35e2..85ae074 100644 (file)
@@ -1,14 +1,21 @@
 package org.craftedsw.feature;
 
-import static org.junit.Assert.*;
+import static org.mockito.Mockito.verify;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
 
+@RunWith(MockitoJUnitRunner.class)
 public class PrintStatementFeature {
 
+       @Mock private Console console;
+       
        @Test public void
        print_statement_containing_all_transactions() {
                
+               account.printStatement();
                
                // console will be some kind of interface that will represent my class console
                // (always using interfaces for external stuff, like databases, etc, etc)