mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 04:17:59 +01:00
Rework FingerprintTest
This commit is contained in:
parent
75eb0c6406
commit
34ea3250c8
1 changed files with 9 additions and 3 deletions
|
@ -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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue