diff --git a/owncloudData/src/test/java/com/owncloud/android/data/user/datasources/implementation/OCRemoteUserDataSourceTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/user/datasources/implementation/OCRemoteUserDataSourceTest.kt index 40e9d0f8658..3a5e3d4354c 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/user/datasources/implementation/OCRemoteUserDataSourceTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/user/datasources/implementation/OCRemoteUserDataSourceTest.kt @@ -55,7 +55,7 @@ class OCRemoteUserDataSourceTest { used = OC_USER_QUOTA.used, free = OC_USER_QUOTA.available, relative = OC_USER_QUOTA.getRelative(), - total = OC_USER_QUOTA.getTotal() + total = OC_USER_QUOTA.total ) private val remoteAvatar = RemoteAvatarData( avatarData = OC_USER_AVATAR.avatarData, diff --git a/owncloudDomain/src/test/java/com/owncloud/android/domain/user/model/UserQuotaTest.kt b/owncloudDomain/src/test/java/com/owncloud/android/domain/user/model/UserQuotaTest.kt index b957686fb75..dd1332e3761 100644 --- a/owncloudDomain/src/test/java/com/owncloud/android/domain/user/model/UserQuotaTest.kt +++ b/owncloudDomain/src/test/java/com/owncloud/android/domain/user/model/UserQuotaTest.kt @@ -30,11 +30,14 @@ class UserQuotaTest { val item = UserQuota( "", 800, - 200 + 200, + 1000, + "normal" ) assertEquals(800, item.available) assertEquals(200, item.used) + assertEquals(1000, item.total) } @Test @@ -42,13 +45,17 @@ class UserQuotaTest { val item1 = UserQuota( accountName = OC_ACCOUNT_NAME, available = 800, - used = 200 + used = 200, + total = 1000, + state = "normal" ) val item2 = UserQuota( OC_ACCOUNT_NAME, 800, - 200 + 200, + 1000, + "normal" ) assertTrue(item1 == item2) @@ -60,13 +67,17 @@ class UserQuotaTest { val item1 = UserQuota( accountName = OC_ACCOUNT_NAME, available = 800, - used = 200 + used = 200, + total = 1000, + state = "normal" ) val item2 = UserQuota( OC_ACCOUNT_NAME, 1000, - 200 + 200, + 1000, + "normal" ) assertFalse(item1 == item2) @@ -78,10 +89,12 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 800_000_000, - used = 20_000_000 + used = 20_000_000, + total = 820_000_000, + state = "normal" ) - assertTrue(item.getTotal() == 820_000_000.toLong()) + assertTrue(item.total == 820_000_000.toLong()) } @Test @@ -89,10 +102,12 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 0, - used = 20_000_000 + used = 20_000_000, + total = 0, + state = "normal" ) - assertTrue(item.getTotal() == 0.toLong()) + assertTrue(item.total == 0.toLong()) } @Test @@ -100,10 +115,12 @@ class UserQuotaTest { val item1 = UserQuota( accountName = OC_ACCOUNT_NAME, available = -3, - used = 20_000_000 + used = 20_000_000, + total = 0, + state = "normal" ) - assertTrue(item1.getTotal() == 0.toLong()) + assertTrue(item1.total == 0.toLong()) } @Test @@ -111,10 +128,12 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 200_000, - used = 20_000 + used = 20_000, + total = 220_000, + state = "normal" ) - assertTrue(item.isLimited()) + assertTrue(item.available > 0) } @Test @@ -122,10 +141,12 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = -3, - used = 20_000 + used = 20_000, + total = 0, + state = "normal" ) - assertFalse(item.isLimited()) + assertFalse(item.available > 0) } @Test @@ -133,7 +154,9 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = -3, - used = 20_000 + used = 20_000, + total = 0, + state = "normal" ) assertEquals(0.0, item.getRelative(), 0.0001) @@ -144,7 +167,9 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 80_000, - used = 20_000 + used = 20_000, + total = 100_000, + state = "normal" ) assertEquals(20.0, item.getRelative(), 0.0001) @@ -155,7 +180,9 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 0, - used = 0 + used = 0, + total = 0, + state = "normal" ) assertEquals(0.0, item.getRelative(), 0.0001) @@ -166,7 +193,9 @@ class UserQuotaTest { val item = UserQuota( accountName = OC_ACCOUNT_NAME, available = 75_000, - used = 20_000 + used = 20_000, + total = 95_000, + state = "normal" ) assertEquals(21.05, item.getRelative(), 0.0001)