From: Gustavo Martin Morcuende Date: Sun, 4 Dec 2016 15:57:30 +0000 (+0100) Subject: Creating test for Account. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=40da8b4dced0893c5bac6124005ec304ab2b196b;p=JavaForFun Creating test for Account. Always write first your asserts. --- 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(); + } + +}