From: David ‘Bombe’ Roden Date: Fri, 1 Nov 2019 17:36:26 +0000 (+0100) Subject: 🚧 Add matcher for trust values X-Git-Tag: v81^2~96 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=11b68b3a9d2437ee951e06779f337b20084f01f0;p=Sone.git 🚧 Add matcher for trust values --- diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt index 83da2ae..3bbdd23 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Matchers.kt @@ -1,5 +1,6 @@ package net.pterodactylus.sone.test +import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.sone.utils.* import net.pterodactylus.util.web.* import org.hamcrest.* @@ -32,3 +33,9 @@ fun isEmptyMap() = object : TypeSafeDiagnosingMatcher>() { } } +fun isTrust(trust: Int?, score: Int?, rank: Int?) = + AttributeMatcher("trust") + .addAttribute("trust", trust, Trust::explicit) + .addAttribute("score", score, Trust::implicit) + .addAttribute("rank", rank, Trust::distance) +