From: David ‘Bombe’ Roden Date: Fri, 1 Nov 2019 18:08:39 +0000 (+0100) Subject: ✅ Add tests for WOTC.setProperty X-Git-Tag: v81^2~84 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ed0b70c34c926fbb44ec61c8be9b9b9af26b1770;p=Sone.git ✅ Add tests for WOTC.setProperty --- 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 18e9ae9..afde66b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt @@ -179,6 +179,24 @@ class WebOfTrustConnectorTest { .connect { removeContext(ownIdentity, "TestContext") } } + @Test + fun `setting a property sends the correct identity id`() { + createPluginConnector("SetProperty", hasField("Identity", equalTo(ownIdentity.id))) + .connect { setProperty(ownIdentity, "TestProperty", "TestValue") } + } + + @Test + fun `setting a property sends the correct property name`() { + createPluginConnector("SetProperty", hasField("Property", equalTo("TestProperty"))) + .connect { setProperty(ownIdentity, "TestProperty", "TestValue") } + } + + @Test + fun `setting a property sends the correct property value`() { + createPluginConnector("SetProperty", hasField("Value", equalTo("TestValue"))) + .connect { setProperty(ownIdentity, "TestProperty", "TestValue") } + } + } private fun PluginConnector.connect(block: WebOfTrustConnector.() -> R) =