generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66bf6e7
commit b68700e
Showing
9 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...src/test/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremesis/AddressTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package uk.gov.justice.digital.hmpps.integrations.approvedpremesis | ||
|
||
import org.hamcrest.MatcherAssert.assertThat | ||
import org.hamcrest.Matchers.equalTo | ||
import org.junit.jupiter.params.ParameterizedTest | ||
import org.junit.jupiter.params.provider.Arguments | ||
import org.junit.jupiter.params.provider.MethodSource | ||
|
||
class AddressTest { | ||
|
||
@ParameterizedTest | ||
@MethodSource("addressLines") | ||
fun testAddressLines(address: Address, addressLines: AddressLines) { | ||
assertThat(address.addressLines, equalTo(addressLines)) | ||
} | ||
|
||
companion object { | ||
|
||
private val address = Address(" ", null, "NN1 1NN", "town", "region") | ||
private const val thirtyFive = "9 this is quite a long address line" | ||
private const val extension = " with an even longer bit on the end" | ||
private const val seventy = thirtyFive + extension | ||
|
||
@JvmStatic | ||
fun addressLines() = listOf( | ||
Arguments.of(address.copy(addressLine1 = thirtyFive), AddressLines(null, thirtyFive, null)), | ||
Arguments.of(address.copy(addressLine1 = thirtyFive, addressLine2 = extension), AddressLines(null, thirtyFive, extension)), | ||
Arguments.of(address.copy(addressLine1 = seventy), AddressLines(null, thirtyFive, extension)), | ||
Arguments.of(address.copy(addressLine1 = seventy, addressLine2 = "with an extra line"), AddressLines(thirtyFive, extension, "with an extra line")) | ||
) | ||
} | ||
} |