blob: 29388a21febfff11df1d896ae5131ba58fa40d1f (
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
|
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.Date;
/** Unit Tests for the Invite Class.
* @author Willem Dalton
**/
@Tag("Model-tier")
public class InviteTest {
@Test
void testConstructor()
{
Golfer testOwner = new Golfer("Jane Doe", "j_doe_rocks", "1234");
Team testTeam = new Team("A Team", testOwner);
Date testDate = new Date(123456);
Invite testInvite = new Invite(testTeam, testDate);
assertEquals(testTeam, testInvite.getTeam());
assertEquals(testDate, testInvite.getSendDate());
}
@Test
void testAccept()
{
Golfer testOwner = new Golfer("Jane Doe", "j_doe_rocks", "1234");
Golfer testInvitee = new Golfer("James Doe", "j_doe_is_cool", "54321");
Team testTeam = new Team("A Team", testOwner);
Date testDate = new Date(123456);
Invite testInvite = new Invite(testTeam, testDate);
testInvite.accept(testInvitee);
assertEquals(testInvitee, testTeam.getMembers()[0]);
}
}
|