--- /dev/null
+package org.craftedsw.feature;
+
+public class Account {
+
+ public void deposit(int amount) {
+ // IDE configuration for always throwing this exception
+ // when automatically creating methods.
+ // In this way, when running our unit tests we are
+ // able to find out what is not yet implemented.
+ throw new UnsupportedOperationException();
+ }
+
+ public void withdraw(int amount) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void printStatement() {
+ throw new UnsupportedOperationException();
+ }
+}
import static org.mockito.Mockito.verify;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
public class PrintStatementFeature {
@Mock private Console console;
+ private Account account;
+
+ @Before
+ public void initialise() {
+ account = new Account();
+ }
@Test public void
print_statement_containing_all_transactions() {
- account.deposti(1000);
+ account.deposit(1000);
// No negative value, instead we use the verb withdraw.
// Semantics are very important in the code!!!
account.withdraw(100);