diff --git a/src/test/kotlin/de/gmuth/ipp/core/IppOperationsTests.kt b/src/test/kotlin/de/gmuth/ipp/core/IppOperationsTests.kt index e316c03b..29b75a0b 100644 --- a/src/test/kotlin/de/gmuth/ipp/core/IppOperationsTests.kt +++ b/src/test/kotlin/de/gmuth/ipp/core/IppOperationsTests.kt @@ -1,19 +1,19 @@ package de.gmuth.ipp.core /** - * Copyright (c) 2020-2023 Gerhard Muth + * Copyright (c) 2020-2024 Gerhard Muth */ import kotlin.test.Test +import kotlin.test.assertEquals import kotlin.test.assertFailsWith class IppOperationsTests { @Test fun unknownOperationCodeFails() { - assertFailsWith { - IppOperation.fromInt(0) - } + val operation = IppOperation.fromInt(0) + assertEquals(IppOperation.Unknown, operation) } } \ No newline at end of file diff --git a/src/test/kotlin/de/gmuth/ipp/core/IppRequestTests.kt b/src/test/kotlin/de/gmuth/ipp/core/IppRequestTests.kt index 77629a7a..8b7a5bb9 100644 --- a/src/test/kotlin/de/gmuth/ipp/core/IppRequestTests.kt +++ b/src/test/kotlin/de/gmuth/ipp/core/IppRequestTests.kt @@ -37,11 +37,11 @@ class IppRequestTests { assertEquals("2.0", request.version) assertEquals(IppOperation.StartupPrinter, request.operation) assertEquals(Charsets.UTF_8, request.attributesCharset) - assertEquals("en-us", request.operationGroup.getValue("attributes-natural-language")) + assertEquals("en", request.operationGroup.getValue("attributes-natural-language")) assertEquals("ipp://foo", request.printerOrJobUri.toString()) assertEquals("Startup-Printer", request.codeDescription) val requestEncoded = request.encode() - assertEquals(100, requestEncoded.size) + assertEquals(97, requestEncoded.size) } @Test @@ -64,7 +64,7 @@ class IppRequestTests { assertNotNull(operationGroup) operationGroup.run { assertEquals(Charsets.UTF_8, getValue("attributes-charset")) - assertEquals("en-us", getValue("attributes-natural-language")) + assertEquals("en", getValue("attributes-natural-language")) assertEquals(URI.create("ipp://printer"), getValue("printer-uri")) } assertEquals(listOf("one", "two"), requestedAttributes)