blob: 58aff490d3218d386a24cf3eadf565a66194b25d (
plain) (
blame)
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 design.model;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
/** Tests for the hole model class.
* @author Willem Dalton
*/
@Tag("Model-tier")
public class HoleTest {
@Test
void testValidEquals()
{
Hole hole1 = new Hole(0, 10);
Hole hole2 = new Hole(0, 10);
assertTrue(hole1.equals(hole2));
}
@Test
void testNotAHole()
{
Hole hole1 = new Hole(0, 10);
String notAHole = "ImNotAHole!";
assertFalse(hole1.equals(notAHole));
}
@Test
void testNotEquals()
{
Hole hole1 = new Hole(0, 10);
Hole hole2 = new Hole(10, 999);
assertFalse(hole1.equals(hole2));
}
@Test
void testNotEqualPar()
{
Hole hole1 = new Hole(0, 10);
Hole hole2 = new Hole(0, 999);
assertFalse(hole1.equals(hole2));
}
@Test
void testNotEqualNumber()
{
Hole hole1 = new Hole(0, 10);
Hole hole2 = new Hole(10, 10);
assertFalse(hole1.equals(hole2));
}
}
|