X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FWebOfTrustConnectorTest.kt;h=afde66bbde98ba1db4922c9852beda496e7a94cd;hb=ed0b70c34c926fbb44ec61c8be9b9b9af26b1770;hp=84f1f98a42aad098cc912caf92ad4abda4a2f95d;hpb=c35d21adc8cb8a039749b838d399e2131b40d222;p=Sone.git 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 84f1f98..afde66b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustConnectorTest.kt @@ -155,6 +155,48 @@ class WebOfTrustConnectorTest { )) } + @Test + fun `adding a context sends the correct own identity id`() { + createPluginConnector("AddContext", hasField("Identity", equalTo(ownIdentity.id))) + .connect { addContext(ownIdentity, "TestContext") } + } + + @Test + fun `adding a context sends the correct context`() { + createPluginConnector("AddContext", hasField("Context", equalTo("TestContext"))) + .connect { addContext(ownIdentity, "TestContext") } + } + + @Test + fun `removing a context sends the correct own identity id`() { + createPluginConnector("RemoveContext", hasField("Identity", equalTo(ownIdentity.id))) + .connect { removeContext(ownIdentity, "TestContext") } + } + + @Test + fun `removing a context sends the correct context`() { + createPluginConnector("RemoveContext", hasField("Context", equalTo("TestContext"))) + .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) =