1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-15 17:02:06 +01:00

Basic FingerprintTest

This commit is contained in:
Paul Schaub 2023-06-30 18:06:58 +02:00
parent 2e3c83f1f6
commit bc64f285ef
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -0,0 +1,30 @@
package org.pgpainless.wot.dijkstra
import org.junit.jupiter.api.Test
import org.pgpainless.wot.dijkstra.sq.Fingerprint
import kotlin.test.assertEquals
import kotlin.test.assertFalse
class FingerprintTest {
@Test
fun testConstructor() {
val finger1 = Fingerprint("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
val finger2 = Fingerprint("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
assert(finger1 == finger2)
assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", finger1.fingerprint)
assertEquals(finger1.hashCode(), finger2.hashCode())
}
@Test
fun testEquals() {
val finger1 = Fingerprint("0000000000000000000000000000000000000000")
val finger2 = Fingerprint("1111111111111111111111111111111111111111")
assertFalse { finger1.equals(null) }
assert(finger1 == finger1)
assert(finger1 != finger2)
assertFalse { finger1.equals("2222222222222222222222222222222222222222") }
}
}