|
|
|
Artima SuiteRunner |
Why |
Getting Started |
Tutorial |
Get Help |
Discuss |
Print |
Email |
First Page |
Previous |
Next
|
Suite Execution by Overriding execute
|
Advertisement
|
Account Test Script
Here's a complete hand-written script that performs
basic testing of class Account:
# Test Account's constructor newAccount getBalance 0 # Constructor should initialize balance to zero. # Test Account's deposit method newAccount deposit 20 getBalance 20 deposit 20 getBalance 40 deposit -1 java.lang.IllegalArgumentException newAccount deposit 9223372036854775807 # Deposit Long.MAX_VALUE getBalance 9223372036854775807 newAccount deposit 100 deposit 9223372036854775807 java.lang.ArithmeticException # Test Account's withdraw method newAccount deposit 20 withdraw 10 getBalance 10 withdraw 10 getBalance 0 withdraw 10 com.artima.examples.account.ex6.InsufficientFundsException newAccount withdraw -1 java.lang.IllegalArgumentException