✅ Add tests for WOTC.setProperty
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Nov 2019 18:08:39 +0000 (19:08 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Nov 2019 18:08:39 +0000 (19:08 +0100)
src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt

index 18e9ae9..afde66b 100644 (file)
@@ -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 <R> PluginConnector.connect(block: WebOfTrustConnector.() -> R) =