コード例 #1
0
 @Test
 public void canGetAllAttributes() {
   SpinList<SpinXmlAttribute> attributes = element.attrs();
   assertThat(attributes).hasSize(4);
   for (SpinXmlAttribute attribute : attributes) {
     assertThat(attribute.name()).isIn("order", "dueUntil", "xmlns", "ex");
   }
 }
コード例 #2
0
 @Test
 public void canGetAllAttributesByNullNamespace() {
   SpinList<SpinXmlAttribute> attributes = element.attrs(null);
   for (SpinXmlAttribute attribute : attributes) {
     assertThat(attribute.name()).isIn("order", "dueUntil");
     assertThat(attribute.value()).isIn("order1", "20150112");
     assertThat(attribute.namespace()).isNull();
   }
 }
コード例 #3
0
 @Test
 public void canGetAllAttributesByNamespace() {
   SpinList<SpinXmlAttribute> attributes = element.attrs(EXAMPLE_NAMESPACE);
   for (SpinXmlAttribute attribute : attributes) {
     assertThat(attribute.name()).isIn("order", "dueUntil");
     assertThat(attribute.value()).isIn("order1", "20150112");
     assertThat(attribute.namespace()).isEqualTo(EXAMPLE_NAMESPACE);
   }
 }
コード例 #4
0
 @Test
 public void canReadAttributeByName() {
   SpinXmlAttribute attribute = element.attr("order");
   String value = attribute.value();
   assertThat(value).isEqualTo("order1");
 }
コード例 #5
0
 @Test
 public void canReadAttributeByNamespaceAndName() {
   SpinXmlAttribute attribute = element.attrNs(EXAMPLE_NAMESPACE, "dueUntil");
   String value = attribute.value();
   assertThat(value).isEqualTo("20150112");
 }