Add unit test on SyncServiceState.toSyncState

This commit is contained in:
Benoit Marty 2024-09-12 14:22:11 +02:00 committed by Benoit Marty
parent e2a4fbbd61
commit 9ae7e998c0

View file

@ -0,0 +1,23 @@
/*
* Copyright 2024 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only
* Please see LICENSE in the repository root for full details.
*/
package io.element.android.libraries.matrix.impl.sync
import com.google.common.truth.Truth.assertThat
import io.element.android.libraries.matrix.api.sync.SyncState
import org.junit.Test
import org.matrix.rustcomponents.sdk.SyncServiceState
class AppStateMapperKtTest {
@Test
fun toSyncState() {
assertThat(SyncServiceState.IDLE.toSyncState()).isEqualTo(SyncState.Idle)
assertThat(SyncServiceState.RUNNING.toSyncState()).isEqualTo(SyncState.Running)
assertThat(SyncServiceState.TERMINATED.toSyncState()).isEqualTo(SyncState.Terminated)
assertThat(SyncServiceState.ERROR.toSyncState()).isEqualTo(SyncState.Error)
}
}