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.time.LocalDateTime; import java.util.ArrayList; /** Unit Tests for the Round class. * @author Willem Dalton **/ @Tag("Model-tier") public class RoundTest { @Test void testConstructor() { Course testCourse = new Course(0, "Rolling Waves", 62, "Rochester, NY", 9, 20, new ArrayList()); LocalDateTime testTime = LocalDateTime.now(); Hole testHole = new Hole(0,3); Round testRound = new Round(testCourse, testTime, testHole); assertEquals(testCourse, testRound.getCourse()); assertEquals(testTime, testRound.getDateTime()); assertEquals(testHole, testRound.getStartingHole()); } @Test void testHolePlay() { Course testCourse = new Course(0, "Rolling Waves", 62, "Rochester, NY", 9, 20, new ArrayList()); LocalDateTime testTime = LocalDateTime.now(); Hole testHole = new Hole(0,3); Round testRound = new Round(testCourse, testTime, testHole); Play testPlay = new Play(0); testRound.addPlay(testPlay); assertEquals(1, testRound.getPlays().length); assertEquals(testPlay, testRound.getPlays()[0]); } }