-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathYourPlayerTest.java
More file actions
55 lines (38 loc) · 1.35 KB
/
YourPlayerTest.java
File metadata and controls
55 lines (38 loc) · 1.35 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
package com.hangman.players;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class YourPlayerTest {
@Test
public void GuessesAWhenThereAreNoSuccessfulCharactersGuessedYet() {
YourPlayer player = new YourPlayer();
char guess = player.GetGuess(Arrays.asList('_', '_', '_'));
assertEquals('e', guess);
}
@Test
public void GuessesAWhenThereAreSuccessfulCharactersGuessedThatAreNotA() {
YourPlayer player = new YourPlayer();
char guess = player.GetGuess(Arrays.asList('m', 'e', '_', 'n'));
assertEquals('a', guess);
}
@Test
public void DoNotGuessAIfAlreadyGuessed(){
YourPlayer player = new YourPlayer();
char guess = player.GetGuess(Arrays.asList('_', 'a', '_'));
assertEquals('e', guess);
}
@Test
public void ReturnConsonantInOrderOfPopularity(){
YourPlayer player = new YourPlayer();
List<Character> currentClue = Arrays.asList('a', 'e', 'i', '_', 'o', 'u', 'y');
char guess = player.GetGuess(currentClue);
assertEquals('s', guess);
}
@Test
public void ShouldAddToListOfUsedChars(){
YourPlayer player = new YourPlayer();
player.addToUsedChars('a');
assertEquals(true, player.usedChars.contains('a'));
}
}