@Test(expected = IllegalArgumentException.class) public void failsWhenUnblockingAnUnblockedCurrency() { cut.unblockCurrencies(new ForexSymbol("EURCHF")); }
@Override public void unblockCurrencies(final ForexSymbol symbol) { if (isTradingAllowed(symbol)) { throw new IllegalArgumentException("Should unblock te currencies of symbol " + symbol + " for trading but one or both currencies are not blocked."); } currenciesInvestedIn.remove(symbol.getBaseCurrency()); currenciesInvestedIn.remove(symbol.getQuoteCurrency()); }
OneTradePerCurrency implements TradeBlocker { @Override public void unblockCurrencies(final ForexSymbol symbol) { if (isTradingAllowed(symbol)) { throw new IllegalArgumentException("Should unblock te currencies of symbol " + symbol + " for trading but one or both currencies are not blocked."); } currenciesInvestedIn.remove(symbol.getBaseCurrency()); currenciesInvestedIn.remove(symbol.getQuoteCurrency()); } }
OneTradePerCurrency implements TradeBlocker { @Override public void unblockCurrencies(final ForexSymbol symbol) { if (isTradingAllowed(symbol)) { throw new IllegalArgumentException("Should unblock te currencies of symbol " + symbol + " for trading but one or both currencies are not blocked."); } currenciesInvestedIn.remove(symbol.getBaseCurrency()); currenciesInvestedIn.remove(symbol.getQuoteCurrency()); }  }
OneTradePerCurrency implements TradeBlocker { @Override public void unblockCurrencies(final ForexSymbol symbol) { if (isTradingAllowed(symbol)) { throw new IllegalArgumentException("Should unblock te currencies of symbol " + symbol + " for trading but one or both currencies are not blocked."); } currenciesInvestedIn.remove(symbol.getBaseCurrency()); currenciesInvestedIn.remove(symbol.getQuoteCurrency()); }  @Override boolean isTradingAllowed(final ForexSymbol symbol); @Override void blockCurrencies(final ForexSymbol symbol); @Override void unblockCurrencies(final ForexSymbol symbol); }
OneTradePerCurrency implements TradeBlocker { @Override public void unblockCurrencies(final ForexSymbol symbol) { if (isTradingAllowed(symbol)) { throw new IllegalArgumentException("Should unblock te currencies of symbol " + symbol + " for trading but one or both currencies are not blocked."); } currenciesInvestedIn.remove(symbol.getBaseCurrency()); currenciesInvestedIn.remove(symbol.getQuoteCurrency()); }  @Override boolean isTradingAllowed(final ForexSymbol symbol); @Override void blockCurrencies(final ForexSymbol symbol); @Override void unblockCurrencies(final ForexSymbol symbol);  }