mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 12:27:58 +01:00
Basic FingerprintTest
This commit is contained in:
parent
2e3c83f1f6
commit
bc64f285ef
1 changed files with 30 additions and 0 deletions
|
@ -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") }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue