davidliu

more room cleanup test

@@ -22,6 +22,7 @@ import org.mockito.junit.MockitoJUnit @@ -22,6 +22,7 @@ import org.mockito.junit.MockitoJUnit
22 import org.mockito.kotlin.* 22 import org.mockito.kotlin.*
23 import org.robolectric.RobolectricTestRunner 23 import org.robolectric.RobolectricTestRunner
24 import org.webrtc.EglBase 24 import org.webrtc.EglBase
  25 +import java.lang.Exception
25 26
26 @ExperimentalCoroutinesApi 27 @ExperimentalCoroutinesApi
27 @RunWith(RobolectricTestRunner::class) 28 @RunWith(RobolectricTestRunner::class)
@@ -135,5 +136,14 @@ class RoomTest { @@ -135,5 +136,14 @@ class RoomTest {
135 Assert.assertEquals(true, events[1] is RoomEvent.TrackUnpublished) 136 Assert.assertEquals(true, events[1] is RoomEvent.TrackUnpublished)
136 Assert.assertEquals(true, events[2] is RoomEvent.ParticipantDisconnected) 137 Assert.assertEquals(true, events[2] is RoomEvent.ParticipantDisconnected)
137 Assert.assertEquals(true, events[3] is RoomEvent.Disconnected) 138 Assert.assertEquals(true, events[3] is RoomEvent.Disconnected)
  139 +
  140 + var localParticipantEmpty = false
  141 + try{
  142 + room.localParticipant // should throw
  143 + } catch (e: Exception) {
  144 + localParticipantEmpty = true
  145 + }
  146 + Assert.assertTrue(localParticipantEmpty)
  147 + Assert.assertTrue(room.remoteParticipants.isEmpty())
138 } 148 }
139 } 149 }