Skip to content

Commit

Permalink
test: replaced string by UserQuotaState enum of state values from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Nov 13, 2024
1 parent cf310ff commit 279a92f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UserQuotaTest {
800,
200,
1000,
"normal"
UserQuotaState.NORMAL
)

assertEquals(800, item.available)
Expand All @@ -47,15 +47,15 @@ class UserQuotaTest {
available = 800,
used = 200,
total = 1000,
state = "normal"
state = UserQuotaState.NORMAL
)

val item2 = UserQuota(
OC_ACCOUNT_NAME,
800,
200,
1000,
"normal"
UserQuotaState.NORMAL
)

assertTrue(item1 == item2)
Expand All @@ -69,15 +69,15 @@ class UserQuotaTest {
available = 800,
used = 200,
total = 1000,
state = "normal"
state = UserQuotaState.NORMAL
)

val item2 = UserQuota(
OC_ACCOUNT_NAME,
1000,
200,
1000,
"normal"
UserQuotaState.NORMAL
)

assertFalse(item1 == item2)
Expand All @@ -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())
Expand All @@ -104,7 +104,7 @@ class UserQuotaTest {
available = 0,
used = 20_000_000,
total = 0,
state = "normal"
state = UserQuotaState.NORMAL
)

assertTrue(item.total == 0.toLong())
Expand All @@ -117,7 +117,7 @@ class UserQuotaTest {
available = -3,
used = 20_000_000,
total = 0,
state = "normal"
state = UserQuotaState.NORMAL
)

assertTrue(item1.total == 0.toLong())
Expand All @@ -130,7 +130,7 @@ class UserQuotaTest {
available = 200_000,
used = 20_000,
total = 220_000,
state = "normal"
state = UserQuotaState.NORMAL
)

assertTrue(item.available > 0)
Expand All @@ -143,7 +143,7 @@ class UserQuotaTest {
available = -3,
used = 20_000,
total = 0,
state = "normal"
state = UserQuotaState.NORMAL
)

assertFalse(item.available > 0)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -182,7 +182,7 @@ class UserQuotaTest {
available = 0,
used = 0,
total = 0,
state = "normal"
state = UserQuotaState.NORMAL
)

assertEquals(0.0, item.getRelative(), 0.0001)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 279a92f

Please sign in to comment.