From f141226405842577a117c6ca769aa9ed57b0bda8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 1 Nov 2019 20:02:23 +0100 Subject: [PATCH] =?utf8?q?=E2=9C=85=20Add=20tests=20for=20WOTC.setTrust?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../sone/freenet/wot/WebOfTrustConnectorTest.kt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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) = -- 2.7.4