@Test public void shouldReturnCorrectDescriptionForType() throws Exception { final String desc = "basic description attribute of a type element"; final String testXmlString = "<types>" + " <type name=\"testTypeDescription\" primitiveType=\"char\" description=\"" + desc + "\"/>" + "</types>"; final Map<String, Type> map = parseTestXmlWithMap("/types/type", testXmlString); assertThat(map.get("testTypeDescription").description(), is(desc)); }
@Test public void shouldReturnNullOnNoDescriptionSet() throws Exception { final String testXmlString = "<types>" + " <type name=\"testTypeNoDescription\" primitiveType=\"char\"/>" + "</types>"; final Map<String, Type> map = parseTestXmlWithMap("/types/type", testXmlString); final String description = map.get("testTypeNoDescription").description(); Assert.assertNull(description); }