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 588B

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