Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bidetofevil committed Mar 14, 2024
1 parent e67609a commit 0c8dd3a
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ internal class SdkModeBehaviorTest {
) {
assertFalse(isBetaFeaturesEnabled())
assertFalse(isSdkDisabled())
assertFalse(isServiceInitDeferred())
}
}

Expand Down Expand Up @@ -86,6 +87,28 @@ internal class SdkModeBehaviorTest {
assertFalse(behavior.isBetaFeaturesEnabled())
}

@Test
fun `verify defer service init checks`() {
// Default is disabled regardless of the deviceId
assertFalse(fakeSdkModeBehavior(thresholdCheck = enabled).isServiceInitDeferred())

// Enabled if remote flag set to 100%
assertTrue(
fakeSdkModeBehavior(
thresholdCheck = enabled,
remoteCfg = { RemoteConfig(pctDeferServiceInitEnabled = 100f) }
).isServiceInitDeferred()
)

// Disabled if remote flag set to 0% regardless of deviceId
assertFalse(
fakeSdkModeBehavior(
thresholdCheck = enabled,
remoteCfg = { RemoteConfig(pctDeferServiceInitEnabled = 0f) }
).isServiceInitDeferred()
)
}

@Test
fun testMetadataDebug() {
val behaviorNotDebug =
Expand Down

0 comments on commit 0c8dd3a

Please sign in to comment.