@Test public void onBuild_whenJustDropoffPlaceProvided_shouldSucceed() throws Exception { new RideRequestParameters.Builder().setPickupPlace(HOME).setDropoffPlace(HOME).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_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(); }