-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContestantTest.java
More file actions
87 lines (78 loc) · 2.53 KB
/
ContestantTest.java
File metadata and controls
87 lines (78 loc) · 2.53 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
76
77
78
79
80
81
82
83
84
85
86
87
/**
* Lab 8
*
* Test suite for the Contestant enum.
*
* @author Stephen
* @version 2018-03-12
*
*/
public class ContestantTest
{
/**
* Tests that George's region is the expected value.
*/
public void contestantGeorgeGetRegionTest() throws AssertException
{
Assert.assertEquals(Region.NORTH, Contestant.GEORGE.getRegion());
}
/**
* Tests that Jill's region is the expected value.
*/
public void contestantJillGetRegionTest() throws AssertException
{
Assert.assertEquals(Region.SOUTH, Contestant.JILL.getRegion());
}
/**
* Tests that Matthew's region is the expected value.
*/
public void contestantMatthewGetRegionTest() throws AssertException
{
Assert.assertEquals(Region.EAST, Contestant.MATTHEW.getRegion());
}
/**
* Tests that Betty's region is the expected value.
*/
public void contestantBettyGetRegionTest() throws AssertException
{
Assert.assertEquals(Region.WEST, Contestant.BETTY.getRegion());
}
/**
* Tests that George's hand choice is the expected value.
*/
public void contestantGeorgeGetChoiceTest() throws AssertException
{
Assert.assertEquals(HandChoice.ROCK, Contestant.GEORGE.getChoice());
}
/**
* Tests that Jill's hand choice is the expected value.
*/
public void contestantJillGetChoiceTest() throws AssertException
{
Assert.assertEquals(HandChoice.ROCK, Contestant.JILL.getChoice());
}
/**
* Tests that Matthew's hand choice is the expected value.
*/
public void contestantMatthewGetChoiceTest() throws AssertException
{
Assert.assertEquals(HandChoice.SCISSORS, Contestant.MATTHEW.getChoice());
}
/**
* Tests that Betty's hand choice is the expected value.
*/
public void contestantBettyGetChoiceTest() throws AssertException
{
Assert.assertEquals(HandChoice.PAPER, Contestant.BETTY.getChoice());
}
/**
* Tests that Supercontestant.toString() returns the expected value for each contestant.
*/
public void contestantToStringTest() throws AssertException
{
Assert.assertEquals("george: contestant from north throwing rock", Contestant.GEORGE.toString());
Assert.assertEquals("jill: contestant from south throwing rock", Contestant.JILL.toString());
Assert.assertEquals("matthew: contestant from east throwing scissors", Contestant.MATTHEW.toString());
Assert.assertEquals("betty: contestant from west throwing paper", Contestant.BETTY.toString());
}
}