From: David ‘Bombe’ Roden Date: Fri, 1 Nov 2019 19:02:23 +0000 (+0100) Subject: ✅ Add tests for WOTC.setTrust X-Git-Tag: v81^2~81 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f141226405842577a117c6ca769aa9ed57b0bda8;p=Sone.git ✅ Add tests for WOTC.setTrust --- diff --git a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt index 340d9ca..384768b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt @@ -262,6 +262,30 @@ class WebOfTrustConnectorTest { assertThat(trust, isTrust(12, 34, null)) } + @Test + fun `setting trust sends correct own identity id`() { + createPluginConnector("SetTrust", hasField("Truster", equalTo(ownIdentity.id))) + .connect { setTrust(ownIdentity, identity, 123, "Test Trust") } + } + + @Test + fun `setting trust sends correct identity id`() { + createPluginConnector("SetTrust", hasField("Trustee", equalTo(identity.id))) + .connect { setTrust(ownIdentity, identity, 123, "Test Trust") } + } + + @Test + fun `setting trust sends correct trust value`() { + createPluginConnector("SetTrust", hasField("Value", equalTo("123"))) + .connect { setTrust(ownIdentity, identity, 123, "Test Trust") } + } + + @Test + fun `setting trust sends correct comment`() { + createPluginConnector("SetTrust", hasField("Comment", equalTo("Test Trust"))) + .connect { setTrust(ownIdentity, identity, 123, "Test Trust") } + } + } private fun PluginConnector.connect(block: WebOfTrustConnector.() -> R) =