some code samples, various examples of simple modeling ideas and some minor algorithms.

AccountTest.java 763B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. public class AccountTest
  6. {
  7. /**
  8. * Default constructor for test class AccountTest
  9. */
  10. public AccountTest()
  11. {
  12. }
  13. /**
  14. * Sets up the test fixture.
  15. *
  16. * Called before every test case method.
  17. */
  18. @Before
  19. public void setUp()
  20. {
  21. }
  22. /**
  23. * Tears down the test fixture.
  24. *
  25. * Called after every test case method.
  26. */
  27. @After
  28. public void tearDown()
  29. {
  30. }
  31. @Test
  32. public void testAccountBalance()
  33. {
  34. Account account=new Account(999);
  35. int expected=999;
  36. int actual=account.balance();
  37. assertEquals(actual,expected);
  38. }
  39. }