/** @see {@link HtmlFormEntryUtil#getProgram(String)} this is the name test */ @Test @Verifies(value = "should find a program by its name", method = "getProgram(String)") public void getProgram_shouldFindAProgramByItsName() throws Exception { Assert.assertEquals( "71779c39-d289-4dfe-91b5-e7cfaa27c78b", HtmlFormEntryUtil.getProgram("MDR-TB PROGRAM").getUuid()); }
/** @see {@link HtmlFormEntryUtil#getProgram(String)} */ @Test @Verifies(value = "should return null otherwise", method = "getProgram(String)") public void getPerson_shouldReturnNullOtherwise() throws Exception { String id = null; Assert.assertNull(HtmlFormEntryUtil.getProgram(id)); id = ""; Assert.assertNull(HtmlFormEntryUtil.getProgram(id)); id = "100000"; // not exist in the standardTestData Assert.assertNull(HtmlFormEntryUtil.getProgram(id)); id = "ASDFASDFEAF"; // random string Assert.assertNull(HtmlFormEntryUtil.getProgram(id)); id = "-"; // uuid style Assert.assertNull(HtmlFormEntryUtil.getProgram(id)); }
/** @see {@link HtmlFormEntryUtil#getProgram(String)} id test */ @Test @Verifies(value = "should find a program by its Id", method = "getProgram(String)") public void getProgram_shouldFindAProgramByItsId() throws Exception { Assert.assertEquals("MDR program", HtmlFormEntryUtil.getProgram("2").getName()); }