source: protocol/src/test/java/geniusweb/protocol/tournament/TeamTest.java@ 52

Last change on this file since 52 was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 1.3 KB
Line 
1package geniusweb.protocol.tournament;
2
3import static org.junit.Assert.assertEquals;
4
5import java.net.URISyntaxException;
6import java.util.Arrays;
7import java.util.List;
8
9import org.junit.Before;
10import org.junit.Test;
11
12import geniusweb.references.Parameters;
13import geniusweb.references.PartyRef;
14import geniusweb.references.PartyWithParameters;
15import tudelft.utilities.junit.GeneralTests;
16
17public 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}
Note: See TracBrowser for help on using the repository browser.