From 63b76dd17fadbf789653c26bbf5b5975da0d4643 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 15:59:05 +0100 Subject: [PATCH] Writing the asserts and the trigger for those asserts. --- .../bank/src/main/java/org/craftedsw/feature/Console.java | 9 +++++++++ .../test/java/org/craftedsw/feature/PrintStatementFeature.java | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Console.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 index 0000000..64785e5 --- /dev/null +++ b/TDD/sandromancuso/bank/src/main/java/org/craftedsw/feature/Console.java @@ -0,0 +1,9 @@ +package org.craftedsw.feature; + +public class Console { + + public void printLine(String text) { + throw new UnsupportedOperationException(); + } + +} diff --git a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java index 0af35e2..85ae074 100644 --- a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java @@ -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) -- 2.1.4