From 40da8b4dced0893c5bac6124005ec304ab2b196b Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 16:57:30 +0100 Subject: [PATCH] Creating test for Account. Always write first your asserts. --- .../test/java/org/craftedsw/feature/AccountShould.java | 18 ++++++++++++++++++ .../org/craftedsw/feature/TransactionRepository.java | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java create mode 100644 TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepository.java 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 new file mode 100644 index 0000000..9b2c441 --- /dev/null +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java @@ -0,0 +1,18 @@ +package org.craftedsw.feature; + +import static org.mockito.Mockito.verify; + +import org.junit.Test; + +public class AccountShould { + + private TransactionRepository transactionRepository; + + @Test public void + store_a_deposit_transaction() { + + + verify(transactionRepository).addDeposit(100); + } + +} diff --git a/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepository.java b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepository.java new file mode 100644 index 0000000..a8a86f1 --- /dev/null +++ b/TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepository.java @@ -0,0 +1,9 @@ +package org.craftedsw.feature; + +public class TransactionRepository { + + public void addDeposit(int amount) { + throw new UnsupportedOperationException(); + } + +} -- 2.1.4