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

ScrabbleTest.java 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. @Test
  14. public void ScrabbleTest(){
  15. //expected
  16. int expected = 5;
  17. //actaul
  18. int actual = Scrabble.score("gato");
  19. assertEquals(expected, actual);
  20. }
  21. @Test
  22. public void ScrabbleTest2(){
  23. int expected = 8;
  24. int actual = Scrabble.score("house");
  25. assertEquals(expected, actual);
  26. }
  27. @Test
  28. public void ScrabbleTest3(){
  29. int expected = 22;
  30. int actual = Scrabble.score("quiz");
  31. assertEquals(expected, actual);
  32. }
  33. @Test
  34. public void ScrabbleTest4(){
  35. int expected = 13;
  36. int actual = Scrabble.score("yugioh");
  37. assertEquals(expected, actual);
  38. }
  39. @Test
  40. public void ScrabbleTest5(){
  41. int expected = 5;
  42. int actual = Scrabble.score("ps4");
  43. assertEquals(expected, actual);
  44. }
  45. @Test
  46. public void ScrabbleTest6(){
  47. int expected = 11;
  48. int actual = Scrabble.score("iphone");
  49. assertEquals(expected, actual);
  50. }
  51. @Test
  52. public void ScrabbleTest7(){
  53. int expected = 10;
  54. int actual = Scrabble.score("samsung");
  55. assertEquals(expected, actual);
  56. }
  57. @Test
  58. public void ScrabbleTest8(){
  59. int expected = 23;
  60. int actual = Scrabble.score("philosophy");
  61. assertEquals(expected, actual);
  62. }
  63. @Test
  64. public void ScrableTest9(){
  65. int expected = 23;
  66. int actual = Scrabble.score("quadrilateral");
  67. assertEquals(expected, actual);
  68. }
  69. }