Skip to content

Commit 30a17d4

Browse files
committed
add EcosystemAppTest
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 4bf04fd commit 30a17d4

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Nextcloud Android Common Library
3+
*
4+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
5+
* SPDX-License-Identifier: MIT
6+
*/
7+
8+
package com.nextcloud.android.common.core.utils
9+
10+
import com.nextcloud.android.common.core.utils.ecosystem.EcosystemApp
11+
import org.junit.Assert.assertEquals
12+
import org.junit.Test
13+
14+
/**
15+
* Unit tests for {@link EcosystemApp}.
16+
*
17+
* These tests ensure that the order of package names is preserved and that
18+
* the first entry for each ecosystem app always represents the production
19+
* package name.
20+
*
21+
* The order is important because the first package name is used when
22+
* redirecting users to the Play Store or resolving fallback behavior.
23+
*/
24+
class EcosystemAppTest {
25+
@Test
26+
fun `first package name must always be the production package`() {
27+
assertEquals(
28+
"com.nextcloud.client",
29+
EcosystemApp.FILES.packageNames.first()
30+
)
31+
32+
assertEquals(
33+
"it.niedermann.owncloud.notes",
34+
EcosystemApp.NOTES.packageNames.first()
35+
)
36+
37+
assertEquals(
38+
"com.nextcloud.talk2",
39+
EcosystemApp.TALK.packageNames.first()
40+
)
41+
}
42+
}

0 commit comments

Comments
 (0)