Fix bug in login page
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / fcp / VersionCommandTest.kt
1 package net.pterodactylus.sone.fcp
2
3 import net.pterodactylus.sone.core.Core
4 import net.pterodactylus.sone.main.SonePlugin
5 import org.hamcrest.MatcherAssert.assertThat
6 import org.hamcrest.Matchers.equalTo
7 import org.junit.Test
8
9 /**
10  * Unit test for [VersionCommand].
11  */
12 class VersionCommandTest : SoneCommandTest() {
13
14         override fun createCommand(core: Core) = VersionCommand(core)
15
16         @Test
17         fun `command does not require write access`() {
18                 assertThat(command.requiresWriteAccess(), equalTo(false))
19         }
20
21         @Test
22         fun `command replies with the correct version information`() {
23                 val replyParameters = command.execute(parameters).replyParameters
24                 assertThat(replyParameters["Message"], equalTo("Version"))
25                 assertThat(replyParameters["Version"], equalTo(SonePlugin.getPluginVersion().toString()))
26                 assertThat(replyParameters["ProtocolVersion"], equalTo("1"))
27         }
28
29 }