forked from Zipcoder/aliceandbob.bluej
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsAliceOrBobTest.java
More file actions
37 lines (29 loc) · 834 Bytes
/
IsAliceOrBobTest.java
File metadata and controls
37 lines (29 loc) · 834 Bytes
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
import org.junit.Assert;
import org.junit.Test;
/**
* @author git-leon
* @version 1.0.0
* @date 5/19/21 5:07 PM
* Used to test `AliceAndBobEngine.isAliceOrBob`
*/
public class IsAliceOrBobTest {
private void testIsAliceOrBob(String input, Boolean expected) {
// given
AliceAndBobEngine evaluator = new AliceAndBobEngine();
// when
Boolean actual = evaluator.isAliceOrBob(input);
// then
Assert.assertEquals(expected, actual);
}
@Test
public void testIsAliceOrBobTrue() {
testIsAliceOrBob("Bob", true);
testIsAliceOrBob("Alice", true);
}
@Test
public void testIsAliceOrBobFalse() {
for (String word : "The Quick Brown Fox Jumps Over The Lazy Dog".split(" ")) {
testIsAliceOrBob(word, false);
}
}
}