Skip to content

Commit c12e556

Browse files
committed
fix(strings): file upload limit message
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent fffca2b commit c12e556

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Nextcloud - Android Client
3+
*
4+
* SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
6+
*/
7+
8+
package com.nextcloud.strings
9+
10+
import android.content.Context
11+
import androidx.test.platform.app.InstrumentationRegistry
12+
import com.nextcloud.client.jobs.upload.FileUploadHelper.Companion.MAX_FILE_COUNT
13+
import com.owncloud.android.R
14+
import org.junit.Assert.assertEquals
15+
import org.junit.Before
16+
import org.junit.Test
17+
18+
class StringsTests {
19+
20+
private lateinit var context: Context
21+
22+
@Before
23+
fun setup() {
24+
context = InstrumentationRegistry.getInstrumentation().targetContext
25+
}
26+
27+
@Test
28+
fun testMaxFileCountText() {
29+
val message = context.resources.getQuantityString(
30+
R.plurals.file_upload_limit_message,
31+
MAX_FILE_COUNT,
32+
MAX_FILE_COUNT
33+
)
34+
35+
assertEquals(message, "You can upload up to 500 files at once.")
36+
}
37+
}

app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class FileUploadHelper {
7373
companion object {
7474
private val TAG = FileUploadWorker::class.java.simpleName
7575

76-
@Suppress("MagicNumber")
7776
const val MAX_FILE_COUNT = 500
7877

7978
val mBoundListeners = HashMap<String, OnDatatransferProgressListener>()
@@ -501,6 +500,7 @@ class FileUploadHelper {
501500
fun showFileUploadLimitMessage(activity: Activity) {
502501
val message = activity.resources.getQuantityString(
503502
R.plurals.file_upload_limit_message,
503+
MAX_FILE_COUNT,
504504
MAX_FILE_COUNT
505505
)
506506
DisplayUtils.showSnackMessage(activity, message)

0 commit comments

Comments
 (0)