private Exchange createExchange() { Exchange exchange = new Exchange(); exchange.id = 1; exchange.meanAmount = (double) 500; ExchangeExtension extension = new ExchangeExtension(exchange); extension.setAmount(42); extension.setFormula("2 * Pi * sqr(r)"); extension.setPropertyId("property-id"); extension.setUnitId("unit-id"); extension.setDefaultProvider("abc-def"); extension.setAvoidedProduct(true); return exchange; }
@Test public void testEmpty() { Exchange raw = new Exchange(); raw.id = 1; Exchange exchange = io(raw); assertTrue(exchange != raw); ExchangeExtension extension = new ExchangeExtension(exchange); assertNull(extension.getAmount()); assertNull(extension.getFormula()); assertNull(extension.getPropertyId()); assertNull(extension.getUnitId()); assertFalse(extension.isValid()); }