Skip to content

Commit 976a767

Browse files
Fix attribute verifiers
1 parent f059341 commit 976a767

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

binary-array-ld-netcdf/src/test/kotlin/net/bald/netcdf/AttributeSourceVerifier.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ class AttributeSourceVerifier(
1616
* Begin verifying attributes on the attribute source.
1717
* Attributes are supplied in the order that they are declared.
1818
* Also verify that the number of attributes verified is equal to the total number of attributes available.
19-
* @param prefix The prefix mapping to apply.
2019
* @param verify A function to perform against the [AttributesVerifier] for the resource.
2120
*/
22-
fun attributes(prefix: PrefixMapping, verify: AttributesVerifier.() -> Unit) {
23-
val attrs = source.attributes(prefix)
21+
fun attributes(verify: AttributesVerifier.() -> Unit) {
22+
val attrs = source.attributes()
2423
val attrIt = attrs.iterator()
2524
AttributesVerifier(source, attrIt).verify()
2625
if (attrIt.hasNext()) {

binary-array-ld-netcdf/src/test/kotlin/net/bald/netcdf/AttributesVerifier.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ class AttributesVerifier(
1313
* Verify that the next attribute has the given properties.
1414
* Begin verifying values on the attribute.
1515
* @param uri The expected attribute URI.
16-
* @param name The expected attribute name.
1716
* @param verify A function to perform against the [AttributeValuesVerifier] for the attribute.
1817
*/
19-
fun attribute(uri: String?, name: String, verify: AttributeValuesVerifier.() -> Unit = {}) {
18+
fun attribute(uri: String, verify: AttributeValuesVerifier.() -> Unit = {}) {
2019
if (attrIt.hasNext()) {
2120
val attr = attrIt.next()
2221
assertEquals(uri, attr.uri, "Wrong URI on attribute $attr.")
23-
assertEquals(name, attr.name, "Wrong name on attribute $attr.")
2422

2523
val valueIt = attr.values.iterator()
2624
AttributeValuesVerifier(attr, valueIt).verify()
2725
if (valueIt.hasNext()) {
2826
fail("Unexpected value on attribute $attr: ${valueIt.next()}")
2927
}
3028
} else {
31-
fail("Expected attribute with name $name on $source, but no more attributes were found.")
29+
fail("Expected attribute with URI $uri on $source, but no more attributes were found.")
3230
}
3331
}
3432
}

0 commit comments

Comments
 (0)