-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandChoiceTest.java
More file actions
50 lines (45 loc) · 1.31 KB
/
HandChoiceTest.java
File metadata and controls
50 lines (45 loc) · 1.31 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
/**
* Lab 8
*
* Test suite for the HandChoice enum.
*
* @author Stephen
* @version 2018-03-12
*
*/
public class HandChoiceTest
{
/**
* Tests that the enum returns the expected HandChoice
* as being weak against the PAPER type.
*/
public void paperEffectiveAgainstTest() throws AssertException
{
Assert.assertEquals(HandChoice.ROCK, HandChoice.PAPER.winsAgainst());
}
/**
* Tests that the enum returns the expected HandChoice
* as being weak against the ROCK type.
*/
public void rockEffectiveAgainstTest() throws AssertException
{
Assert.assertEquals(HandChoice.SCISSORS, HandChoice.ROCK.winsAgainst());
}
/**
* Tests that the enum returns the expected HandChoice
* as being weak against the SCISSORS type.
*/
public void scissorsEffectiveAgainstTest() throws AssertException
{
Assert.assertEquals(HandChoice.PAPER, HandChoice.SCISSORS.winsAgainst());
}
/**
* Tests that HandChoice.toString() returns the expected value.
*/
public void handChoiceToStringTest() throws AssertException
{
Assert.assertEquals("rock", HandChoice.ROCK.toString());
Assert.assertEquals("paper", HandChoice.PAPER.toString());
Assert.assertEquals("scissors", HandChoice.SCISSORS.toString());
}
}