NoDiscount extends Discount { @Override public Double discountedPrice(OrderLineItem lineItem, PlainTextViewModel plainTextViewModel) { Double price = lineItem.price(); plainTextViewModel.addToOriginalTotal(price); plainTextViewModel.addToDiscountedTotal(price); plainTextViewModel.addToLinesSection(lineSummary(lineItem, price)); return price; } NoDiscount(int priority); static NoDiscount noDiscount(); @Override Double discountedPrice(OrderLineItem lineItem, PlainTextViewModel plainTextViewModel);  }
@Test public void shouldConcatLineOutput() throws Exception { NoDiscount noDiscount = new NoDiscount(0); double price = noDiscount.discountedPrice(new OrderLineItem(new Product("abc", "ItemXXX", 10d, "bottle", null), 10), new PlainTextViewModel()); assertThat(price, is(100d)); }