Skip to content

Commit 75f16b0

Browse files
committed
refactor: removed one unnecessary test from OCUserRepositoryTest and reordered parameters from UserQuota constructor
1 parent 25eea33 commit 75f16b0

File tree

2 files changed

+8
-19
lines changed
  • owncloudData/src/test/java/com/owncloud/android/data/user/repository
  • owncloudTestUtil/src/main/java/com/owncloud/android/testutil

2 files changed

+8
-19
lines changed

owncloudData/src/test/java/com/owncloud/android/data/user/repository/OCUserRepositoryTest.kt

+1-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author Abel García de Prada
55
* @author Jorge Aguado Recio
66
*
7-
* Copyright (C) 2024 ownCloud GmbH.
7+
* Copyright (C) 2025 ownCloud GmbH.
88
*
99
* This program is free software: you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License version 2,
@@ -113,20 +113,6 @@ class OCUserRepositoryTest {
113113
}
114114
}
115115

116-
@Test
117-
fun `getStoredUserQuotaAsFlow returns a Flow with null when local datasource returns a Flow with null`() = runTest {
118-
every {
119-
localUserDataSource.getQuotaForAccountAsFlow(OC_ACCOUNT_NAME)
120-
} returns flowOf(null)
121-
122-
val userQuota = ocUserRepository.getStoredUserQuotaAsFlow(OC_ACCOUNT_NAME).first()
123-
assertNull(userQuota)
124-
125-
verify(exactly = 1) {
126-
localUserDataSource.getQuotaForAccountAsFlow(OC_ACCOUNT_NAME)
127-
}
128-
}
129-
130116
@Test
131117
fun `getAllUserQuotas returns a list of UserQuota`() {
132118
every {

owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCUser.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* ownCloud Android client application
33
*
44
* @author Abel García de Prada
5-
* Copyright (C) 2020 ownCloud GmbH.
5+
* @author Jorge Aguado Recio
6+
*
7+
* Copyright (C) 2025 ownCloud GmbH.
68
*
79
* This program is free software: you can redistribute it and/or modify
810
* it under the terms of the GNU General Public License version 2,
@@ -16,6 +18,7 @@
1618
* You should have received a copy of the GNU General Public License
1719
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1820
*/
21+
1922
package com.owncloud.android.testutil
2023

2124
import com.owncloud.android.domain.user.model.UserAvatar
@@ -31,24 +34,24 @@ val OC_USER_INFO = UserInfo(
3134

3235
val OC_USER_QUOTA = UserQuota(
3336
accountName = OC_ACCOUNT_NAME,
34-
used = 80_000,
3537
available = 200_000,
38+
used = 80_000,
3639
total = 280_000,
3740
state = null
3841
)
3942

4043
val OC_USER_QUOTA_WITHOUT_PERSONAL = UserQuota(
4144
accountName = OC_ACCOUNT_NAME,
42-
used = 0,
4345
available = -4L,
46+
used = 0,
4447
total = 0,
4548
state = UserQuotaState.NORMAL
4649
)
4750

4851
val OC_USER_QUOTA_UNLIMITED = UserQuota(
4952
accountName = OC_ACCOUNT_NAME,
50-
used = 5_000,
5153
available = -3L,
54+
used = 5_000,
5255
total = 0,
5356
state = UserQuotaState.NORMAL
5457
)

0 commit comments

Comments
 (0)