Commit 4b24a5d1 authored by travis79's avatar travis79
Browse files

Fix tests dependent on max bucket count

parent 00c0201c
......@@ -454,13 +454,13 @@ class ExperimentEvaluatorTest {
override fun getClientId(context: Context): String = "c641eacf-c30c-4171-b403-f077724e848a"
})
assertEquals(79, evaluator1.getUserBucket(testContext))
assertEquals(779, evaluator1.getUserBucket(testContext))
val evaluator2 = ExperimentEvaluator(object : ValuesProvider() {
override fun getClientId(context: Context): String = "01a15650-9a5d-4383-a7ba-2f047b25c620"
})
assertEquals(55, evaluator2.getUserBucket(testContext))
assertEquals(355, evaluator2.getUserBucket(testContext))
}
@Test
......@@ -482,25 +482,25 @@ class ExperimentEvaluatorTest {
}
distribution
.groupingBy { it }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 0..25)
}
.groupingBy { it / 10 }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 0..25)
}
distribution
.groupingBy { it / 10 }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 50..150)
}
.groupingBy { it / 100 }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 50..150)
}
distribution
.groupingBy { it / 50 }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 350..650)
}
.groupingBy { it / 500 }
.eachCount()
.forEach {
Assert.assertTrue(it.value in 350..650)
}
}
@Test
......
......@@ -750,7 +750,7 @@ class ExperimentsTest {
resetExperiments(valuesProvider = ValuesProvider())
experiments.initialize(context, configuration)
assertTrue(experiments.getUserBucket(mockContext) == 54)
assertEquals(954, experiments.getUserBucket(mockContext))
}
@Test
......@@ -763,14 +763,14 @@ class ExperimentsTest {
})
experiments.initialize(context, configuration)
assertEquals(79, experiments.getUserBucket(context))
assertEquals(779, experiments.getUserBucket(context))
resetExperiments(source, storage, object : ValuesProvider() {
override fun getClientId(context: Context): String = "01a15650-9a5d-4383-a7ba-2f047b25c620"
})
experiments.initialize(context, configuration)
assertEquals(55, experiments.getUserBucket(context))
assertEquals(355, experiments.getUserBucket(context))
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment