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

ScrabbleTest.java 880B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. /**
  14. * Default constructor for test class ScrabbleTest
  15. */
  16. public ScrabbleTest()
  17. {
  18. }
  19. @Test
  20. public void testScore(){
  21. String word = "world";
  22. int score = 9;
  23. int expected = 9;
  24. int actual = Scrabble.score(word);
  25. assertEquals(expected,actual);
  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. }