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

ScrabbleTest.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 ScrabbleTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class ScrabbleTest
  12. {
  13. private Scrabble scrabble;
  14. /**
  15. * Default constructor for test class ScrabbleTest
  16. */
  17. public ScrabbleTest()
  18. {
  19. }
  20. /**
  21. * Sets up the test fixture.
  22. *
  23. * Called before every test case method.
  24. */
  25. @Before
  26. public void setUp()
  27. {
  28. Scrabble scrabble = new Scrabble();
  29. }
  30. /**
  31. * Tears down the test fixture.
  32. *
  33. * Called after every test case method.
  34. */
  35. @After
  36. public void tearDown()
  37. {
  38. }
  39. @Test
  40. public void scoreDog(){
  41. int expected = 5;
  42. int actual = scrabble.score("dog");
  43. assertEquals(expected, actual);
  44. }
  45. @Test
  46. public void scoreFirework(){
  47. int expected = 18;
  48. int actual = scrabble.score("firework");
  49. assertEquals(expected, actual);
  50. }
  51. @Test
  52. public void scoreZumba(){
  53. int expected = 18;
  54. int actual = scrabble.score("zumba");
  55. assertEquals(expected, actual);
  56. }
  57. }