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.

KtIrcIntegrationTest.kt 1021B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.dmdirc.ktirc
  2. import com.dmdirc.irctest.IrcLibraryTests
  3. import kotlinx.coroutines.runBlocking
  4. import org.junit.jupiter.api.TestFactory
  5. class KtIrcIntegrationTest {
  6. @TestFactory
  7. fun dynamicTests() = IrcLibraryTests().getTests(object : IrcLibraryTests.IrcLibrary {
  8. private lateinit var ircClient : IrcClient
  9. override fun connect(nick: String, ident: String, realName: String, password: String?) {
  10. ircClient = IrcClient {
  11. server {
  12. host = "localhost"
  13. port = 12321
  14. this.password = password
  15. }
  16. profile {
  17. nickname = nick
  18. username = ident
  19. this.realName = realName
  20. }
  21. }
  22. ircClient.connect()
  23. }
  24. override fun terminate() {
  25. runBlocking {
  26. ircClient.disconnect()
  27. }
  28. }
  29. })
  30. }