@Test public void onBuild_whenJustDropoffCoordinatesProvided_shouldSucceed() throws Exception { new RideRequestParameters.Builder().setPickupPlace(HOME).setDropoffCoordinates(30f, -122f).build(); }
private static RideRequestParameters createUberPoolRideRequest() { return new RideRequestParameters.Builder() .setPickupCoordinates(PICKUP_LATITUDE, PICKUP_LONGITUDE) .setDropoffCoordinates(DROPOFF_LATITUDE, DROPOFF_LONGITUDE) .setProductId(UBER_POOL_PRODUCT_ID) .setSeatCount(2) .build(); }
@Test public void build_whenBothDropoffPlaceAndLongitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of dropoff place or dropoff coordinates must " + "be specified"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(null, -122f) .setDropoffPlace(HOME) .build(); }
@Test public void build_whenBothDropoffPlaceAndCoordinatesProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of dropoff place or dropoff coordinates must " + "be specified"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(30f, -122f) .setDropoffPlace(HOME) .build(); }
@Test public void build_whenBothDropoffPlaceIdAndCoordinatesProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of dropoff place or dropoff coordinates must " + "be specified"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(30f, -122f) .setDropoffPlaceId("home") .build(); }
private static RideRequestParameters createUberPoolRideRequestV1Estimate() { return new RideRequestParameters.Builder() .setPickupCoordinates(PICKUP_LATITUDE, PICKUP_LONGITUDE) .setDropoffCoordinates(DROPOFF_LATITUDE, DROPOFF_LONGITUDE) .setProductId(UBER_POOL_PRODUCT_ID) .setSeatCount(4) .build(); }
@Test public void build_whenJustDropoffLatitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("If using coordinates, both dropoff latitude and dropoff " + "longitude must be present"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(30f, null).build(); }
private static RideRequestParameters createRideRequestV1Estimate() { return new RideRequestParameters.Builder() .setPickupCoordinates(PICKUP_LATITUDE, PICKUP_LONGITUDE) .setDropoffCoordinates(DROPOFF_LATITUDE, DROPOFF_LONGITUDE) .setSeatCount(4) .build(); }
@Test public void build_whenBothDropoffPlaceAndLatitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of dropoff place or dropoff coordinates must " + "be specified"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(30f, null) .setDropoffPlace(HOME) .build(); }
@Test public void build_whenJustDropoffLongitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("If using coordinates, both dropoff latitude and dropoff " + "longitude must be present"); new RideRequestParameters.Builder() .setPickupPlace(HOME) .setDropoffCoordinates(null, -122f) .build(); }
private static RideRequestParameters createRideRequest() { return new RideRequestParameters.Builder() .setPickupCoordinates(PICKUP_LATITUDE, PICKUP_LONGITUDE) .setDropoffCoordinates(DROPOFF_LATITUDE, DROPOFF_LONGITUDE) .setSeatCount(2) .build(); }