1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Rework FingerprintTest

This commit is contained in:
Paul Schaub 2023-07-03 15:52:02 +02:00
parent 75eb0c6406
commit 34ea3250c8
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -8,17 +8,23 @@ import kotlin.test.assertFalse
class FingerprintTest { class FingerprintTest {
@Test @Test
fun testConstructor() { fun `verify that Fingerprint applies an uppercase() on the constructor argument`() {
val fromLowerCase = Fingerprint("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", fromLowerCase.fingerprint)
}
@Test
fun `verify that objects constructed from the lower- and uppercase representation do equal`() {
val finger1 = Fingerprint("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") val finger1 = Fingerprint("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
val finger2 = Fingerprint("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") val finger2 = Fingerprint("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
assert(finger1 == finger2) assert(finger1 == finger2)
assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", finger1.fingerprint)
assertEquals(finger1.hashCode(), finger2.hashCode()) assertEquals(finger1.hashCode(), finger2.hashCode())
} }
@Test @Test
fun testEquals() { fun `verify the proper function of the equals() method and == operator`() {
val finger1 = Fingerprint("0000000000000000000000000000000000000000") val finger1 = Fingerprint("0000000000000000000000000000000000000000")
val finger2 = Fingerprint("1111111111111111111111111111111111111111") val finger2 = Fingerprint("1111111111111111111111111111111111111111")