Two more routing integration tests.

This commit is contained in:
Vladimir Byko-Ianko 2018-04-25 10:04:21 +03:00 committed by Aleksandr Zatsepin
parent 033e383431
commit 4365e74941

View file

@ -929,3 +929,34 @@ UNIT_TEST(USATampaTest)
integration::GetNthTurn(route, 0).TestValid().TestOneOfDirections(
{CarDirection::TurnSlightRight, CarDirection::TurnRight});
}
// Test on go straight direction if it's possible to go through a roundabout.
UNIT_TEST(RussiaMoscowMinskia1TurnTest)
{
TRouteResult const routeResult =
integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(),
MercatorBounds::FromLatLon(55.7355, 37.48717), {0., 0.},
MercatorBounds::FromLatLon(55.73694, 37.48587));
Route const & route = *routeResult.first;
IRouter::ResultCode const result = routeResult.second;
TEST_EQUAL(result, IRouter::NoError, ());
integration::TestTurnCount(route, 1 /* expectedTurnCount */);
integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::GoStraight);
}
UNIT_TEST(RussiaMoscowMinskia2TurnTest)
{
TRouteResult const routeResult =
integration::CalculateRoute(integration::GetVehicleComponents<VehicleType::Car>(),
MercatorBounds::FromLatLon(55.74244, 37.4808), {0., 0.},
MercatorBounds::FromLatLon(55.74336, 37.48124));
Route const & route = *routeResult.first;
IRouter::ResultCode const result = routeResult.second;
TEST_EQUAL(result, IRouter::NoError, ());
integration::TestTurnCount(route, 1 /* expectedTurnCount */);
integration::GetNthTurn(route, 0).TestValid().TestDirection(CarDirection::TurnRight);
}