Skip to content

Commit 8439c10

Browse files
committed
Add test on AccountManagementAction.toRustAction()
1 parent f209eb2 commit 8439c10

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2024 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only
5+
* Please see LICENSE in the repository root for full details.
6+
*/
7+
8+
package io.element.android.libraries.matrix.impl.oidc
9+
10+
import com.google.common.truth.Truth.assertThat
11+
import io.element.android.libraries.matrix.api.oidc.AccountManagementAction
12+
import io.element.android.libraries.matrix.test.A_DEVICE_ID
13+
import org.junit.Test
14+
import org.matrix.rustcomponents.sdk.AccountManagementAction as RustAccountManagementAction
15+
16+
class AccountManagementActionKtTest {
17+
@Test
18+
fun `test AccountManagementAction to RustAccountManagementAction`() {
19+
assertThat(AccountManagementAction.Profile.toRustAction())
20+
.isEqualTo(RustAccountManagementAction.Profile)
21+
assertThat(AccountManagementAction.SessionEnd(A_DEVICE_ID).toRustAction())
22+
.isEqualTo(RustAccountManagementAction.SessionEnd(A_DEVICE_ID.value))
23+
assertThat(AccountManagementAction.SessionView(A_DEVICE_ID).toRustAction())
24+
.isEqualTo(RustAccountManagementAction.SessionView(A_DEVICE_ID.value))
25+
assertThat(AccountManagementAction.SessionsList.toRustAction())
26+
.isEqualTo(RustAccountManagementAction.SessionsList)
27+
}
28+
}

0 commit comments

Comments
 (0)