mirror of
https://gitlab.com/dadada_/uuidgen.git
synced 2025-06-07 17:43:57 +02:00
Add UuidTest
This commit is contained in:
parent
b7be97798a
commit
1cf157628e
1 changed files with 28 additions and 0 deletions
28
app/src/test/java/li/dadada/uuidgen/model/UuidTest.kt
Normal file
28
app/src/test/java/li/dadada/uuidgen/model/UuidTest.kt
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
package li.dadada.uuidgen.model
|
||||||
|
|
||||||
|
import org.junit.Assert.assertFalse
|
||||||
|
import org.junit.Assert.assertTrue
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class UuidTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `random UUID are not equal`() {
|
||||||
|
val u1 = Uuid()
|
||||||
|
val u2 = Uuid()
|
||||||
|
assertFalse(u1 == u2)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `UUIDs with same id are equal`() {
|
||||||
|
val u1 = Uuid()
|
||||||
|
val u2 = Uuid(uuid = u1.uuid)
|
||||||
|
assertTrue(u1 == u2)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `UUID is self identical`() {
|
||||||
|
val u1 = Uuid()
|
||||||
|
assertTrue(u1 == u1)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue