1 package club.wpia.gigi.dbObjects;
3 import static org.junit.Assert.*;
7 import club.wpia.gigi.GigiApiException;
8 import club.wpia.gigi.dbObjects.Country;
9 import club.wpia.gigi.dbObjects.Name;
10 import club.wpia.gigi.dbObjects.NamePart;
11 import club.wpia.gigi.dbObjects.User;
12 import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
13 import club.wpia.gigi.dbObjects.Country.CountryCodeType;
14 import club.wpia.gigi.dbObjects.NamePart.NamePartType;
15 import club.wpia.gigi.testUtils.ClientBusinessTest;
16 import club.wpia.gigi.util.Notary;
18 public class TestAssureName extends ClientBusinessTest {
21 public void testIt() throws GigiApiException {
22 User u0 = User.getById(createAssuranceUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
23 Name n2 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
24 Name n3 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
25 Name n4 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaac"));
27 assertEquals(0, n0.getAssurancePoints());
28 Notary.assure(u0, u, n0, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
29 assertEquals(10, n0.getAssurancePoints());
30 Notary.assure(u0, u, n2, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
31 assertEquals(10, n2.getAssurancePoints());
32 Notary.assure(u0, u, n3, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
33 assertEquals(10, n3.getAssurancePoints());
34 Notary.assure(u0, u, n4, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
35 assertEquals(10, n4.getAssurancePoints());
36 assertEquals(10, u.getMaxAssurePoints());