summaryrefslogtreecommitdiff
path: root/src/test/java/design/model/ClubTest.java
blob: 9cbfa87d3c5f1163d894e4ffdaa9522df3526c21 (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
56
57
58
59
60
61
package design.model;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import design.model.Club.ClubType;

/** Unit Tests for the Club class.
 * @author Willem Dalton
 **/
@Tag("Model-tier")
public class ClubTest {
    
    @Test
    void testConstructor()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);

        assertEquals(0, testClub.getId());
        assertEquals("John Doe", testClub.getManufacture());
        assertEquals("The Slammer", testClub.getNickname());
        assertEquals(ClubType.DRIVER, testClub.getClubType());
    }

    @Test
    void testGetClubType()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);
        assertEquals(ClubType.DRIVER, testClub.getClubType());
    }

    @Test
    void testGetNickname()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);
        assertEquals("The Slammer", testClub.getNickname());
    }

    @Test
    void testGetManufacture()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);
        assertEquals("John Doe", testClub.getManufacture());
    }

    @Test
    void testGetId()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);
        assertEquals(0, testClub.getId());
    }

    @Test
    void testToString()
    {
        Club testClub = new Club(0, "John Doe", "The Slammer", ClubType.DRIVER);
        String expectedString = "#0 The Slammer - John Doe (DRIVER)";
        assertEquals(expectedString, testClub.toString());
    }
}