コード例 #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 canGetAllAttributesByNonExistingNamespace() {
   SpinList<SpinXmlAttribute> attributes = element.attrs(NON_EXISTING);
   assertThat(attributes).isEmpty();
 }