From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 14:46:11 +0000 (+0100) Subject: First acceptance test X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=edf5934db168c32f187ff2c49d630f66fe8cf368;p=JavaForFun First acceptance test Use interfaces for representing the external world. --- 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 new file mode 100644 index 0000000..0af35e2 --- /dev/null +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/PrintStatementFeature.java @@ -0,0 +1,21 @@ +package org.craftedsw.feature; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class PrintStatementFeature { + + @Test public void + print_statement_containing_all_transactions() { + + + // console will be some kind of interface that will represent my class console + // (always using interfaces for external stuff, like databases, etc, etc) + verify(console).printLine("DATE | AMOUNT | BALANCE"); + verify(console).printLine("10 / 04 / 2014 | 500.00 | 1400.00"); + verify(console).printLine("02 / 04 / 2014 | -100.00 | 900.00"); + verify(console).printLine("01 / 04 / 2014 | 1000.00 | 1000.00"); + } + +}