|
@@ -95,26 +95,6 @@ internal class IrcClientImplTest {
|
95
|
95
|
assertEquals(TestConstants.time, captor.secondValue.time)
|
96
|
96
|
}
|
97
|
97
|
|
98
|
|
- @Test
|
99
|
|
- fun `emits disconnected event with local time when read channel closed`() = runBlocking {
|
100
|
|
- currentTimeProvider = { TestConstants.time }
|
101
|
|
- val client = IrcClientImpl(Server(HOST, PORT), Profile(NICK, REAL_NAME, USER_NAME))
|
102
|
|
- client.socketFactory = mockSocketFactory
|
103
|
|
- client.connect()
|
104
|
|
-
|
105
|
|
- client.onEvent(mockEventHandler)
|
106
|
|
- readLineChannel.close()
|
107
|
|
-
|
108
|
|
- // Horrible hacks to make sure we've disconnected.
|
109
|
|
- while (client.serverState.status != ServerStatus.Disconnected) {
|
110
|
|
- delay(10)
|
111
|
|
- }
|
112
|
|
-
|
113
|
|
- val captor = argumentCaptor<ServerDisconnected>()
|
114
|
|
- verify(mockEventHandler, timeout(500).atLeast(2)).invoke(captor.capture())
|
115
|
|
- assertEquals(TestConstants.time, captor.lastValue.time)
|
116
|
|
- }
|
117
|
|
-
|
118
|
98
|
@Test
|
119
|
99
|
fun `sends basic connection strings`() = runBlocking {
|
120
|
100
|
val client = IrcClientImpl(Server(HOST, PORT), Profile(NICK, REAL_NAME, USER_NAME))
|