summaryrefslogtreecommitdiff
path: root/src/test/java/design/model/CourseTest.java
blob: b6dd4a54bb9b0a9c28a0b2a71bd3c0a5a21de0b3 (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
package design.model;

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

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;


/** Unit Tests for the Course class.
 * @author Willem Dalton
 **/
@Tag("Model-tier")
public class CourseTest{
    
    @Test
    void testConstructor()
    {
        Course testCourse = new Course(0, "Rolling Waves", 62, "Rochester, NY", 9, 20, new ArrayList<Hole>());
        assertEquals(0, testCourse.getId());
        assertEquals("Rolling Waves", testCourse.getName());
        assertEquals(62, testCourse.getDifficultyRating());
        assertEquals("Rochester, NY", testCourse.getLocation());
        assertEquals(9, testCourse.getHoleCount());
        assertEquals(20, testCourse.getTotalPar());
        assertEquals(0, testCourse.getHoles().size());
    }

    @Test
    void testToString()
    {
        Course testCourse = new Course(0, "Rolling Waves", 62, "Rochester, NY", 9, 20, new ArrayList<Hole>());
        assertEquals("Rolling Waves (Rochester, NY) | Holes: 9 | Total Par: 20 | Difficulty: 62.0", testCourse.toString());
    }
}