🎨 Replace WOT connector with Kotlin version
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / freenet / wot / WebOfTrustConnectorTest.kt
index 384768b..2d02e3a 100644 (file)
@@ -51,25 +51,25 @@ class WebOfTrustConnectorTest {
 
        @Test
        fun `trusted identities are requested with correct own identity`() {
-               val pluginConnector = createPluginConnector("GetIdentitiesByScore", hasField("Truster", equalTo("id")))
+               createPluginConnector("GetIdentitiesByScore", hasField("Truster", equalTo("id")))
                                .connect { loadTrustedIdentities(ownIdentity) }
        }
 
        @Test
        fun `trusted identities are requested with correct selection parameter`() {
-               val pluginConnector = createPluginConnector("GetIdentitiesByScore", hasField("Selection", equalTo("+")))
+               createPluginConnector("GetIdentitiesByScore", hasField("Selection", equalTo("+")))
                                .connect { loadTrustedIdentities(ownIdentity) }
        }
 
        @Test
        fun `trusted identities are requested with empty context if null context requested`() {
-               val pluginConnector = createPluginConnector("GetIdentitiesByScore", hasField("Context", equalTo("")))
+               createPluginConnector("GetIdentitiesByScore", hasField("Context", equalTo("")))
                                .connect { loadTrustedIdentities(ownIdentity) }
        }
 
        @Test
        fun `trusted identities are requested with context if context requested`() {
-               val pluginConnector = createPluginConnector("GetIdentitiesByScore", hasField("Context", equalTo("TestContext")))
+               createPluginConnector("GetIdentitiesByScore", hasField("Context", equalTo("TestContext")))
                                .connect { loadTrustedIdentities(ownIdentity, "TestContext") }
        }
 
@@ -286,6 +286,18 @@ class WebOfTrustConnectorTest {
                                .connect { setTrust(ownIdentity, identity, 123, "Test Trust") }
        }
 
+       @Test
+       fun `removing trust sends correct own identity id`() {
+               createPluginConnector("RemoveTrust", hasField("Truster", equalTo(ownIdentity.id)))
+                               .connect { removeTrust(ownIdentity, identity) }
+       }
+
+       @Test
+       fun `removing trust sends correct identity id`() {
+               createPluginConnector("RemoveTrust", hasField("Trustee", equalTo(identity.id)))
+                               .connect { removeTrust(ownIdentity, identity) }
+       }
+
 }
 
 private fun <R> PluginConnector.connect(block: WebOfTrustConnector.() -> R) =