Skip to content

Commit 3ffafdd

Browse files
committed
Add test on isConnected()
1 parent f84aa03 commit 3ffafdd

File tree

1 file changed

+37
-0
lines changed
  • libraries/matrix/api/src/test/kotlin/io/element/android/libraries/matrix/api/sync

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2025 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
package io.element.android.libraries.matrix.api.sync
9+
10+
import org.junit.Test
11+
12+
class SyncStateTest {
13+
@Test
14+
fun `isConnected should return true for Idle`() {
15+
assert(SyncState.Idle.isConnected())
16+
}
17+
18+
@Test
19+
fun `isConnected should return true for Running`() {
20+
assert(SyncState.Running.isConnected())
21+
}
22+
23+
@Test
24+
fun `isConnected should return true for Error`() {
25+
assert(SyncState.Error.isConnected())
26+
}
27+
28+
@Test
29+
fun `isConnected should return true for Terminated`() {
30+
assert(SyncState.Terminated.isConnected())
31+
}
32+
33+
@Test
34+
fun `isConnected should return false for Offline`() {
35+
assert(!SyncState.Offline.isConnected())
36+
}
37+
}

0 commit comments

Comments
 (0)