]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/dbObjects/TestVerifyName.java
upd: terminology in code
[gigi.git] / tests / club / wpia / gigi / dbObjects / TestVerifyName.java
diff --git a/tests/club/wpia/gigi/dbObjects/TestVerifyName.java b/tests/club/wpia/gigi/dbObjects/TestVerifyName.java
new file mode 100644 (file)
index 0000000..7f3af26
--- /dev/null
@@ -0,0 +1,38 @@
+package club.wpia.gigi.dbObjects;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import club.wpia.gigi.GigiApiException;
+import club.wpia.gigi.dbObjects.Country;
+import club.wpia.gigi.dbObjects.Name;
+import club.wpia.gigi.dbObjects.NamePart;
+import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.dbObjects.Verification.VerificationType;
+import club.wpia.gigi.dbObjects.Country.CountryCodeType;
+import club.wpia.gigi.dbObjects.NamePart.NamePartType;
+import club.wpia.gigi.testUtils.ClientBusinessTest;
+import club.wpia.gigi.util.Notary;
+
+public class TestVerifyName extends ClientBusinessTest {
+
+    @Test
+    public void testIt() throws GigiApiException {
+        User u0 = User.getById(createVerificationUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
+        Name n2 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
+        Name n3 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
+        Name n4 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaac"));
+
+        assertEquals(0, n0.getVerificationPoints());
+        Notary.verify(u0, u, n0, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n0.getVerificationPoints());
+        Notary.verify(u0, u, n2, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n2.getVerificationPoints());
+        Notary.verify(u0, u, n3, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n3.getVerificationPoints());
+        Notary.verify(u0, u, n4, u.getDoB(), 10, "test mgr", validVerificationDateString(), VerificationType.FACE_TO_FACE, Country.getCountryByCode("DE", CountryCodeType.CODE_2_CHARS));
+        assertEquals(10, n4.getVerificationPoints());
+        assertEquals(10, u.getMaxVerifyPoints());
+    }
+}