🎨 Replace image count comparator with Kotlin version
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / test / Mocks.kt
index 3b2c716..65f279a 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Sone - Mocks.kt - Copyright Â© 2019 David â€˜Bombe’ Roden
+ * Sone - Mocks.kt - Copyright Â© 2019–2020 David â€˜Bombe’ Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -32,6 +32,8 @@ val remoteSone2 = createRemoteSone()
 val localSone1 = createLocalSone()
 val localSone2 = createLocalSone()
 
+val createRequestUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri
+val createInsertUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").insertURI
 fun createId() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri.routingKey.asFreenetBase64
 
 fun createLocalSone(id: String? = createId()) = object : IdOnlySone(id) {
@@ -59,3 +61,6 @@ fun emptyPostReply(text: String = "", post: Post? = createPost(), sone: Sone = r
        override fun isKnown() = known
        override fun setKnown(known: Boolean): PostReply = this
 }
+
+fun createImage(sone: Sone): Image =
+               ImageImpl().modify().setSone(sone).update()