You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PingHandlerTest.kt 647B

12345678910111213141516171819202122
  1. package com.dmdirc.ktirc.events
  2. import com.dmdirc.ktirc.IrcClient
  3. import com.dmdirc.ktirc.TestConstants
  4. import com.nhaarman.mockitokotlin2.mock
  5. import com.nhaarman.mockitokotlin2.verify
  6. import kotlinx.coroutines.runBlocking
  7. import org.junit.jupiter.api.Test
  8. internal class PingHandlerTest {
  9. private val ircClient = mock<IrcClient>()
  10. private val handler = PingHandler()
  11. @Test
  12. fun `PingHandler responses to pings with a pong`() = runBlocking {
  13. handler.processEvent(ircClient, PingReceived(TestConstants.time, "the_plague".toByteArray()))
  14. verify(ircClient).send("PONG :the_plague")
  15. }
  16. }