-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OffRoute detection disabled bug #783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments on the tests (not blocker though)
@@ -70,6 +69,39 @@ public void defaultEngines_didGetInitialized() throws Exception { | |||
assertNotNull(navigation.getOffRouteEngine()); | |||
} | |||
|
|||
@Test | |||
public void offRouteEngine_doesNotGetInitializedWithFalseOption() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally is good to structure the tests following the triple A 👀 https://speakerdeck.com/guardiola31337/elegant-unit-testing-mobilization-2016?slide=40 http://wiki.c2.com/?ArrangeActAssert
If the A
rrange part gets too long we should create factory or builder methods.
This applies to other tests included in MapboxNavigationTest
.
navigation = new MapboxNavigation(mock(Context.class), ACCESS_TOKEN, options, mock(NavigationTelemetry.class), | ||
mock(LocationEngine.class)); | ||
assertNull(navigation.getOffRouteEngine()); | ||
initDefaultNavigation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is initDefaultNavigation()
needed?
👀 FIRST
|
||
List<Milestone> triggeredMilestones | ||
= checkMilestones(routeProgress, routeProgress, mapboxNavigation); | ||
assertEquals(1, triggeredMilestones.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally is preferable having only 1 assertion per test 👀 https://speakerdeck.com/guardiola31337/elegant-unit-testing-mobilization-2016?slide=57
1187e00
to
f71b5d5
Compare
Closes #780