From 279a92fe460b11ec22d65ebacff45322b5e1f012 Mon Sep 17 00:00:00 2001 From: joragua Date: Wed, 13 Nov 2024 13:37:02 +0100 Subject: [PATCH] test: replaced string by UserQuotaState enum of state values from tests --- .../domain/user/model/UserQuotaTest.kt | 28 +++++++++---------- .../com/owncloud/android/testutil/OCUser.kt | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) 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 569cb41d885..b9c40b07bdc 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 @@ -32,7 +32,7 @@ class UserQuotaTest { 800, 200, 1000, - "normal" + UserQuotaState.NORMAL ) assertEquals(800, item.available) @@ -47,7 +47,7 @@ class UserQuotaTest { available = 800, used = 200, total = 1000, - state = "normal" + state = UserQuotaState.NORMAL ) val item2 = UserQuota( @@ -55,7 +55,7 @@ class UserQuotaTest { 800, 200, 1000, - "normal" + UserQuotaState.NORMAL ) assertTrue(item1 == item2) @@ -69,7 +69,7 @@ class UserQuotaTest { available = 800, used = 200, total = 1000, - state = "normal" + state = UserQuotaState.NORMAL ) val item2 = UserQuota( @@ -77,7 +77,7 @@ class UserQuotaTest { 1000, 200, 1000, - "normal" + UserQuotaState.NORMAL ) assertFalse(item1 == item2) @@ -91,7 +91,7 @@ class UserQuotaTest { available = 800_000_000, used = 20_000_000, total = 820_000_000, - state = "normal" + state = UserQuotaState.NORMAL ) assertTrue(item.total == 820_000_000.toLong()) @@ -104,7 +104,7 @@ class UserQuotaTest { available = 0, used = 20_000_000, total = 0, - state = "normal" + state = UserQuotaState.NORMAL ) assertTrue(item.total == 0.toLong()) @@ -117,7 +117,7 @@ class UserQuotaTest { available = -3, used = 20_000_000, total = 0, - state = "normal" + state = UserQuotaState.NORMAL ) assertTrue(item1.total == 0.toLong()) @@ -130,7 +130,7 @@ class UserQuotaTest { available = 200_000, used = 20_000, total = 220_000, - state = "normal" + state = UserQuotaState.NORMAL ) assertTrue(item.available > 0) @@ -143,7 +143,7 @@ class UserQuotaTest { available = -3, used = 20_000, total = 0, - state = "normal" + state = UserQuotaState.NORMAL ) assertFalse(item.available > 0) @@ -156,7 +156,7 @@ class UserQuotaTest { available = -3, used = 20_000, total = 0, - state = "normal" + state = UserQuotaState.NORMAL ) assertEquals(0.0, item.getRelative(), 0.0001) @@ -169,7 +169,7 @@ class UserQuotaTest { available = 80_000, used = 20_000, total = 100_000, - state = "normal" + state = UserQuotaState.NORMAL ) assertEquals(20.0, item.getRelative(), 0.0001) @@ -182,7 +182,7 @@ class UserQuotaTest { available = 0, used = 0, total = 0, - state = "normal" + state = UserQuotaState.NORMAL ) assertEquals(0.0, item.getRelative(), 0.0001) @@ -195,7 +195,7 @@ class UserQuotaTest { available = 75_000, used = 20_000, total = 95_000, - state = "normal" + state = UserQuotaState.NORMAL ) assertEquals(21.05, item.getRelative(), 0.0001) diff --git a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCUser.kt b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCUser.kt index 3cbc2630591..049dbcbebbc 100644 --- a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCUser.kt +++ b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCUser.kt @@ -33,7 +33,7 @@ val OC_USER_QUOTA = UserQuota( used = 80_000, available = 200_000, total = 280_000, - state = "" + state = null ) val OC_USER_AVATAR = UserAvatar(