1 | package geniusweb.protocol.tournament;
|
---|
2 |
|
---|
3 | import static org.junit.Assert.assertEquals;
|
---|
4 |
|
---|
5 | import java.net.URISyntaxException;
|
---|
6 | import java.util.Arrays;
|
---|
7 | import java.util.List;
|
---|
8 |
|
---|
9 | import org.junit.Before;
|
---|
10 | import org.junit.Test;
|
---|
11 |
|
---|
12 | import geniusweb.references.Parameters;
|
---|
13 | import geniusweb.references.PartyRef;
|
---|
14 | import geniusweb.references.PartyWithParameters;
|
---|
15 | import tudelft.utilities.junit.GeneralTests;
|
---|
16 |
|
---|
17 | public class TeamTest extends GeneralTests<Team> {
|
---|
18 |
|
---|
19 | private Team team1, team1a, team2;
|
---|
20 | private PartyWithParameters pwithp1, pwithp2;
|
---|
21 |
|
---|
22 | @Before
|
---|
23 | public void before() throws URISyntaxException {
|
---|
24 | PartyRef partyref1 = new PartyRef("party1");
|
---|
25 | PartyRef partyref2 = new PartyRef("party2");
|
---|
26 | Parameters params1 = new Parameters().with("a", 1);
|
---|
27 | pwithp1 = new PartyWithParameters(partyref1, params1);
|
---|
28 | pwithp2 = new PartyWithParameters(partyref2, params1);
|
---|
29 | team1 = new Team(Arrays.asList(pwithp1));
|
---|
30 | team1a = new Team(Arrays.asList(pwithp1));
|
---|
31 | team2 = new Team(Arrays.asList(pwithp2));
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public List<List<Team>> getGeneralTestData() {
|
---|
36 | return Arrays.asList(Arrays.asList(team1, team1a),
|
---|
37 | Arrays.asList(team2));
|
---|
38 | }
|
---|
39 |
|
---|
40 | @Override
|
---|
41 | public List<String> getGeneralTestStrings() {
|
---|
42 | return Arrays.asList(".PartyRef.party1..a=1..",
|
---|
43 | ".PartyRef.party2..a=1..");
|
---|
44 | }
|
---|
45 |
|
---|
46 | @Test
|
---|
47 | public void testGet() {
|
---|
48 | assertEquals(Arrays.asList(pwithp1), team1.getParties());
|
---|
49 | }
|
---|
50 |
|
---|
51 | }
|
---|