@Test public void whenOrcidSuppliedAllOtherFieldsIgnored() { form.setOrcid("12-34"); form.setFamilyName("Logan"); form.setGivenName("Donald"); form.setInstitutionName("University of Portsmouth"); form.setPastInstitutionsSearchable(true); form.setOtherNamesSearchable(true); form.setKeyword("orcid"); String derivedQueryString = setupQuery().deriveQueryString(); assertEquals("orcid:12-34", derivedQueryString); }
@Test public void whenAllFieldsExceptOrcidProvidedQueryStringDisplaysCorrectPermutations() { form.setFamilyName("Logan"); form.setGivenName("Donald"); form.setInstitutionName("University of Portsmouth"); form.setPastInstitutionsSearchable(true); form.setOtherNamesSearchable(true); form.setKeyword("orcid"); String derivedQueryString = setupQuery().deriveQueryString(); assertEquals( "given-names:donald AND family-name:logan OR other-names:donald AND current-primary-institution-affiliation-name:university of portsmouth OR past-institution-affiliation-name:university of portsmouth AND keyword:orcid", derivedQueryString); }
@Test public void whenKeywordOnlyProvidedOnlyKeywordsDisplayed() { form.setKeyword("Orcid"); String derivedQueryString = setupQuery().deriveQueryString(); assertEquals("keyword:orcid", derivedQueryString); }