This commit is contained in:
Miriam Baglioni 2021-06-21 09:16:05 +02:00
parent ca7e10b3c0
commit 2740b95f99
1 changed files with 90 additions and 0 deletions

View File

@ -1,5 +1,95 @@
package eu.dnetlib.dhp.ircdl_extention;
import java.util.ArrayList;
import java.util.Arrays;
import org.apache.neethi.Assertion;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import eu.dnetlib.dhp.ircdl_extention.model.Orcid;
import eu.dnetlib.dhp.ircdl_extention.model.Result;
import scala.Tuple2;
public class WrongOrcidTest {
@Test
public void wrongOrcidFalse() throws Exception {
Assertions
.assertTrue(
Utils
.filterFunction(
new Tuple2<>(Result.newInstance("veigas pires cristina"),
Orcid
.newInstance(
"cristina", "veiga pires", "c veiga pires",
Arrays.asList("c c veiga pires")))));
}
@Test
public void wrongOrcidFalse2() throws Exception {
Assertions
.assertTrue(
Utils
.filterFunction(
new Tuple2<>(Result.newInstance("yushkevich p"),
Orcid
.newInstance(
"paul", "yushkevich", "paul a yushkevich",
new ArrayList<>()))));
}
@Test
public void wrongOrcidFalse3() throws Exception {
Assertions
.assertTrue(
Utils
.filterFunction(
new Tuple2<>(Result.newInstance("ghosh ss"),
Orcid
.newInstance(
"satrajit", "ghosh",
"satra",
Arrays.asList("satra","satrajit s ghosh")))));
}
@Test
public void wrongOrcidTrue() throws Exception {
Assertions
.assertFalse(
Utils
.filterFunction(
new Tuple2<>(Result.newInstance("kluft lukas"),
Orcid
.newInstance(
"satrajit", "ghosh",
"satra",
Arrays.asList("satra","satrajit s ghosh")))));
}
@Test
public void wrongOrcidFalse4() throws Exception {
Assertions
.assertTrue(
Utils
.filterFunction(
new Tuple2<>(Result.newInstance("schulz s a"),
Orcid
.newInstance(
"sebastian", "schulz",
"sebastian a schulz",
new ArrayList<>()))));
}
}