Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
4b24a5d1
Commit
4b24a5d1
authored
Jun 25, 2019
by
travis79
Browse files
Fix tests dependent on max bucket count
parent
00c0201c
Changes
2
Hide whitespace changes
Inline
Side-by-side
components/service/experiments/src/test/java/mozilla/components/service/experiments/ExperimentEvaluatorTest.kt
View file @
4b24a5d1
...
...
@@ -454,13 +454,13 @@ class ExperimentEvaluatorTest {
override
fun
getClientId
(
context
:
Context
):
String
=
"c641eacf-c30c-4171-b403-f077724e848a"
})
assertEquals
(
79
,
evaluator1
.
getUserBucket
(
testContext
))
assertEquals
(
7
79
,
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
(
3
55
,
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
/
10
0
}
.
eachCount
()
.
forEach
{
Assert
.
assertTrue
(
it
.
value
in
50
..
150
)
}
distribution
.
groupingBy
{
it
/
50
}
.
eachCount
()
.
forEach
{
Assert
.
assertTrue
(
it
.
value
in
350
..
650
)
}
.
groupingBy
{
it
/
50
0
}
.
eachCount
()
.
forEach
{
Assert
.
assertTrue
(
it
.
value
in
350
..
650
)
}
}
@Test
...
...
components/service/experiments/src/test/java/mozilla/components/service/experiments/ExperimentsTest.kt
View file @
4b24a5d1
...
...
@@ -750,7 +750,7 @@ class ExperimentsTest {
resetExperiments
(
valuesProvider
=
ValuesProvider
())
experiments
.
initialize
(
context
,
configuration
)
assert
True
(
experiments
.
getUserBucket
(
mockContext
)
==
54
)
assert
Equals
(
954
,
experiments
.
getUserBucket
(
mockContext
))
}
@Test
...
...
@@ -763,14 +763,14 @@ class ExperimentsTest {
})
experiments
.
initialize
(
context
,
configuration
)
assertEquals
(
79
,
experiments
.
getUserBucket
(
context
))
assertEquals
(
7
79
,
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
(
3
55
,
experiments
.
getUserBucket
(
context
))
}
@Test
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment