44454647484950515253
@Autowired DealProcessor processor; @Test public void processesEquities() { Deal deal = new Deal(new Equity("Deutsche Bank")); Result result = processor.process(deal); assertThat(result.getFee(), is(new BigDecimal(10.5))); }
53545556575859606162
} @Test(expected = UnsupportedInstrumentException.class) public void handlesUnsupportedInstrument() { Deal deal = new Deal(new UnsupportedInstrument()); Result result = processor.process(deal); assertThat(result.getFee(), is(new BigDecimal(0.0))); }
43444546474849505152
5253545556575859
} @Test(expected = UnsupportedInstrumentException.class) public void handlesUnsupportedInstrument() { Deal deal = new Deal(new UnsupportedInstrument()); processor.process(deal); }
59606162636465666768
} @Test public void vmWareEquitiesIsFree() { Deal deal = new Deal(new Equity("VMware")); Result result = processor.process(deal); assertThat(result.getFee(), is(BigDecimal.ZERO)); }