CalculPrice { public static final double mergeDiscount(double productDiscount, double ticketDiscount) { return round(productDiscount + ticketDiscount - (productDiscount * ticketDiscount)); }  static final double getGenericPrice(double price, double discount, double taxe, int binaryMask); static final double removeTaxe(double price, double tax); static final double getDiscountCost(double price, double discount); static final double applyDiscount(double price, double discount); static final double mergeDiscount(double productDiscount, double ticketDiscount); static double applyTax(double price, double taxRate); static double getTaxCost(double price, double taxRate); static double round(double number); static double round(double number, int decimalNumber); static final int DEFAULT_DECIMAL_NUMBER; }
@Test public void mergeDiscountTest() { double control = 50; final double a_price = 50; double p_discount = 0.2; double t_discount = 0.1; double control_discount = 0.28; double discount = CalculPrice.mergeDiscount(p_discount, t_discount); assertEquals(control_discount, discount); }