Creating test for Account.
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 4 Dec 2016 15:57:30 +0000 (16:57 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 4 Dec 2016 22:29:40 +0000 (23:29 +0100)
Always write first your asserts.

TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/AccountShould.java [new file with mode: 0644]
TDD/sandromancuso/bank/src/test/java/org/craftedsw/feature/TransactionRepository.java [new file with mode: 0644]

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 (file)
index 0000000..9b2c441
--- /dev/null
@@ -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 (file)
index 0000000..a8a86f1
--- /dev/null
@@ -0,0 +1,9 @@
+package org.craftedsw.feature;
+
+public class TransactionRepository {
+
+       public void addDeposit(int amount) {
+               throw new UnsupportedOperationException();
+       }
+
+}