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

AccountTest.java 900B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class AccountTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class AccountTest
  12. {
  13. /**
  14. * Default constructor for test class AccountTest
  15. */
  16. public AccountTest()
  17. {
  18. }
  19. @Test
  20. public void testBalance(){
  21. Account account = new Account(1000);
  22. // int amount = 1000;
  23. // int expected = 1000;
  24. //int actual = Account.balance();
  25. assertTrue(account.balance() == 1000);
  26. }
  27. /**
  28. * Sets up the test fixture.
  29. *
  30. * Called before every test case method.
  31. */
  32. @Before
  33. public void setUp()
  34. {
  35. }
  36. /**
  37. * Tears down the test fixture.
  38. *
  39. * Called after every test case method.
  40. */
  41. @After
  42. public void tearDown()
  43. {
  44. }
  45. }