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

index 84f1f98..35a5ffb 100644 (file)
@@ -155,6 +155,18 @@ 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") }
+       }
+
 }
 
 private fun <R> PluginConnector.connect(block: WebOfTrustConnector.() -> R) =