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_whenJustPickupLatitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("If using coordinates, both pickup latitude and pickup longitude " + "must be present"); new RideRequestParameters.Builder().setPickupCoordinates(30f, null).build(); }
@Test public void build_whenBothPickupPlaceAndLongitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of pickup place or pickup coordinates must " + "be specified"); new RideRequestParameters.Builder().setPickupCoordinates(null, -122f).setPickupPlace(HOME).build(); }
@Test public void build_whenBothPickupPlaceAndCoordinatesProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of pickup place or pickup coordinates must " + "be specified"); new RideRequestParameters.Builder().setPickupCoordinates(30f, -122f).setPickupPlace(HOME).build(); }
@Test public void onBuild_whenJustPickupCoordinatesProvided_shouldSucceed() throws Exception { new RideRequestParameters.Builder().setPickupCoordinates(30f, -122f); }
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_whenJustPickupLongitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("If using coordinates, both pickup latitude and pickup longitude " + "must be present"); new RideRequestParameters.Builder().setPickupCoordinates(null, -122f).build(); }
private static RideRequestParameters createRideRequest() { return new RideRequestParameters.Builder() .setPickupCoordinates(PICKUP_LATITUDE, PICKUP_LONGITUDE) .setDropoffCoordinates(DROPOFF_LATITUDE, DROPOFF_LONGITUDE) .setSeatCount(2) .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_whenBothPickupPlaceAndLatitudeProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of pickup place or pickup coordinates must " + "be specified"); new RideRequestParameters.Builder().setPickupCoordinates(30f, null).setPickupPlace(HOME).build(); }
@Test public void build_whenBothPickupPlaceIdAndCoordinatesProvided_shouldFail() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Exactly one of pickup place or pickup coordinates must " + "be specified"); new RideRequestParameters.Builder().setPickupCoordinates(30f, -122f).setPickupPlaceId("home").build(); }