@Test public void testGetCharge() { assertEquals(0.0d, rpc.getCharge(-3), tolerance); assertEquals(0.0d, rpc.getCharge(0), tolerance); assertEquals(2.0d, rpc.getCharge(1), tolerance); assertEquals(2.0d, rpc.getCharge(2), tolerance); assertEquals(3.5d, rpc.getCharge(3), tolerance); assertEquals(5.0d, rpc.getCharge(4), tolerance); assertEquals(32.0d, rpc.getCharge(22), tolerance); }
@Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 2; } if (daysRented > 2) { result = 2 + (daysRented - 2) * 1.5; } return result; }
RegularPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 2; } if (daysRented > 2) { result = 2 + (daysRented - 2) * 1.5; } return result; } }
RegularPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 2; } if (daysRented > 2) { result = 2 + (daysRented - 2) * 1.5; } return result; } private  RegularPriceCategory(); }
RegularPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 2; } if (daysRented > 2) { result = 2 + (daysRented - 2) * 1.5; } return result; } private  RegularPriceCategory(); int getId(); @Override double getCharge(int daysRented); @Override String toString(); static RegularPriceCategory getInstance(); }
RegularPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 2; } if (daysRented > 2) { result = 2 + (daysRented - 2) * 1.5; } return result; } private  RegularPriceCategory(); int getId(); @Override double getCharge(int daysRented); @Override String toString(); static RegularPriceCategory getInstance();  }