source: events/src/test/java/actions/PartyIdTest.java@ 23

Last change on this file since 23 was 22, checked in by bart, 4 years ago

Minor fixes

File size: 1.6 KB
RevLine 
[1]1package actions;
2
3import static org.junit.Assert.assertEquals;
4
5import java.util.Arrays;
6import java.util.List;
7
8import org.junit.Test;
9
10import geniusweb.actions.PartyId;
11import tudelft.utilities.junit.GeneralTests;
12
13public class PartyIdTest extends GeneralTests<PartyId> {
14 private final PartyId id = new PartyId("party1");
15 private final PartyId id1 = new PartyId("party1");
16 private final PartyId idb = new PartyId("party2");
17
18 @Override
19 public List<List<PartyId>> getGeneralTestData() {
20 return Arrays.asList(Arrays.asList(id, id1), Arrays.asList(idb));
21 }
22
23 @Override
24 public List<String> getGeneralTestStrings() {
25 return Arrays.asList("party1", "party2");
26 }
27
[22]28 @SuppressWarnings("unused")
[1]29 @Test(expected = IllegalArgumentException.class)
30 public void testRestrictions() {
31 new PartyId("");
32 }
33
[22]34 @SuppressWarnings("unused")
[1]35 @Test(expected = IllegalArgumentException.class)
36 public void testRestrictions2() {
37 new PartyId("@2");
38 }
39
[22]40 @SuppressWarnings("unused")
[1]41 @Test(expected = IllegalArgumentException.class)
42 public void testRestrictions3() {
43 new PartyId("_12");
44 }
45
[22]46 @SuppressWarnings("unused")
[1]47 @Test(expected = IllegalArgumentException.class)
48 public void testRestrictions4() {
49 new PartyId("12A");
50 }
51
[22]52 @SuppressWarnings("unused")
[1]53 @Test(expected = IllegalArgumentException.class)
54 public void testRestrictions5() {
55 new PartyId(" fds ");
56 }
57
58 @Test
59 public void testGetName() {
60 assertEquals("party1", id.getName());
61 }
62
[22]63 @SuppressWarnings("unused")
[1]64 @Test
65 public void testRestrictions6() {
66 new PartyId("A_1_23_ok");
67 }
68
[22]69 @SuppressWarnings("unused")
[1]70 @Test
71 public void testRestrictions7() {
72 new PartyId("a_1_23_ok");
73 }
74
75}
Note: See TracBrowser for help on using the repository browser.