Search in sources :

Example 1 with PersonNameBuilder

use of nl.knaw.huygens.timbuctoo.model.PersonNameBuilder in project timbuctoo by HuygensING.

the class PersonNameBuilderTest method testTwoComponentsReversed.

@Test
public void testTwoComponentsReversed() {
    PersonNameBuilder builder = new PersonNameBuilder();
    builder.addComponent(new PersonNameComponent(Type.SURNAME, "Huygens"));
    builder.addComponent(new PersonNameComponent(Type.FORENAME, "Christiaan"));
    assertThat(builder.getName(), equalTo("Huygens, Christiaan"));
}
Also used : PersonNameComponent(nl.knaw.huygens.timbuctoo.model.PersonNameComponent) PersonNameBuilder(nl.knaw.huygens.timbuctoo.model.PersonNameBuilder) Test(org.junit.Test)

Example 2 with PersonNameBuilder

use of nl.knaw.huygens.timbuctoo.model.PersonNameBuilder in project timbuctoo by HuygensING.

the class PersonNameBuilderTest method testOneComponent.

@Test
public void testOneComponent() {
    PersonNameBuilder builder = new PersonNameBuilder();
    builder.addComponent(new PersonNameComponent(Type.FORENAME, "Christiaan"));
    assertThat(builder.getName(), equalTo("Christiaan"));
}
Also used : PersonNameComponent(nl.knaw.huygens.timbuctoo.model.PersonNameComponent) PersonNameBuilder(nl.knaw.huygens.timbuctoo.model.PersonNameBuilder) Test(org.junit.Test)

Example 3 with PersonNameBuilder

use of nl.knaw.huygens.timbuctoo.model.PersonNameBuilder in project timbuctoo by HuygensING.

the class PersonNameBuilderTest method testTwoComponents.

@Test
public void testTwoComponents() {
    PersonNameBuilder builder = new PersonNameBuilder();
    builder.addComponent(new PersonNameComponent(Type.FORENAME, "Christiaan"));
    builder.addComponent(new PersonNameComponent(Type.SURNAME, "Huygens"));
    assertThat(builder.getName(), equalTo("Christiaan Huygens"));
}
Also used : PersonNameComponent(nl.knaw.huygens.timbuctoo.model.PersonNameComponent) PersonNameBuilder(nl.knaw.huygens.timbuctoo.model.PersonNameBuilder) Test(org.junit.Test)

Aggregations

PersonNameBuilder (nl.knaw.huygens.timbuctoo.model.PersonNameBuilder)3 PersonNameComponent (nl.knaw.huygens.timbuctoo.model.PersonNameComponent)3 Test (org.junit.Test)3