From 46fce04a44538ab816ef2f8f9a9f40517eae960e Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 10 Apr 2023 23:20:36 +0200 Subject: [PATCH] Added a first, simple KMP test for EpcQrCodeGenerator --- .../EpcQrCodeGeneratorTest.kt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 EpcQrCode/src/commonTest/kotlin/net.codinux.banking.epcqrcode/EpcQrCodeGeneratorTest.kt diff --git a/EpcQrCode/src/commonTest/kotlin/net.codinux.banking.epcqrcode/EpcQrCodeGeneratorTest.kt b/EpcQrCode/src/commonTest/kotlin/net.codinux.banking.epcqrcode/EpcQrCodeGeneratorTest.kt new file mode 100644 index 0000000..fd687f2 --- /dev/null +++ b/EpcQrCode/src/commonTest/kotlin/net.codinux.banking.epcqrcode/EpcQrCodeGeneratorTest.kt @@ -0,0 +1,35 @@ +package net.codinux.banking.epcqrcode + +import kotlin.test.Test +import kotlin.test.assertEquals + +class EpcQrCodeGeneratorTest { + + companion object { + private const val ReceiverName = "Liebe" + private const val ReceiverIban = "DE01234567890123456789" + } + + private val underTest = EpcQrCodeGenerator() + + @Test + fun basicDataOnly() { + val config = EpcQrCodeConfig(ReceiverName, ReceiverIban) + + val result = underTest.generateAsString(config) + + assertEquals(actual = result, expected = """ + BCD + 002 + 1 + SCT + + Liebe + DE01234567890123456789 + + CHAR + + + """.trimIndent()) + } +} \ No newline at end of file