| 1234567891011121314151617181920212223242526272829303132 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
-
- public class AccountTest
- {
- @Test
- public void accountCreationTest() {
- Account actual = new Account(100);
- assertNotNull(actual);
- }
- @Test
- public void depositTest() {
- Account test = new Account(50);
- test.deposit(50);
- int expected = 100;
- int actual = test.balance();
- assertEquals(expected, actual);
- }
- @Test
- public void nullaryConstructorTest() {
- Account test = new Account();
- int expected = 0;
- int actual = test.balance();
- assertEquals(expected, actual);
- }
- }
|