-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScrabbleScoreTest.java
More file actions
75 lines (60 loc) · 1.81 KB
/
ScrabbleScoreTest.java
File metadata and controls
75 lines (60 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ScrabbleScoreTest {
@Test
public void testALowerCaseLetter() {
Scrabble scrabble = new Scrabble("a");
assertEquals(1, scrabble.getScore());
}
@Test
public void testAUpperCaseLetter() {
Scrabble scrabble = new Scrabble("A");
assertEquals(1, scrabble.getScore());
}
@Test
public void testAValuableLetter() {
Scrabble scrabble = new Scrabble("f");
assertEquals(4, scrabble.getScore());
}
@Test
public void testAShortWord() {
Scrabble scrabble = new Scrabble("at");
assertEquals(2, scrabble.getScore());
}
@Test
public void testAShortValuableWord() {
Scrabble scrabble = new Scrabble("zoo");
assertEquals(12, scrabble.getScore());
}
@Test
public void testAMediumWord() {
Scrabble scrabble = new Scrabble("street");
assertEquals(6, scrabble.getScore());
}
@Test
public void testAMediumValuableWord() {
Scrabble scrabble = new Scrabble("quirky");
assertEquals(22, scrabble.getScore());
}
@Test
public void testALongMixCaseWord() {
Scrabble scrabble = new Scrabble("OxyphenButazone");
assertEquals(41, scrabble.getScore());
}
@Test
public void testAEnglishLikeWord() {
Scrabble scrabble = new Scrabble("pinata");
assertEquals(8, scrabble.getScore());
}
@Test
public void testAnEmptyInput() {
Scrabble scrabble = new Scrabble("");
assertEquals(0, scrabble.getScore());
}
@Test
public void testEntireAlphabetAvailable() {
Scrabble scrabble = new Scrabble("abcdefghijklmnopqrstuvwxyz");
assertEquals(87, scrabble.getScore());
}
}