@Test public void allwaysReturnsConfiguredVolume() { final MoneyManagement cut1 = new NonMoneyManagement(new Volume(42, LOT)); final MoneyManagement cut2 = new NonMoneyManagement(new Volume(58, MINI_LOT)); assertThat( cut1.requestVolume(new ForexSymbol("EURUSD"), SOME_PRICE, SOME_PRICE, SOME_STEP_SIZE).get().getVolume()) .isEqualTo(new Volume(42, LOT)); assertThat( cut2.requestVolume(new ForexSymbol("CHFJPY"), SOME_PRICE, SOME_PRICE, SOME_STEP_SIZE).get().getVolume()) .isEqualTo(new Volume(58, MINI_LOT)); cut1.requestVolume(new ForexSymbol("USDCHF"), SOME_PRICE, SOME_PRICE, SOME_STEP_SIZE).get().releaseVolume(); }
@Override public Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice, final Price pipLostOnStopLoose, final Volume allowedStepSize) { return volumeManagement; }
NonMoneyManagement implements MoneyManagement { @Override public Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice, final Price pipLostOnStopLoose, final Volume allowedStepSize) { return volumeManagement; } }
NonMoneyManagement implements MoneyManagement { @Override public Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice, final Price pipLostOnStopLoose, final Volume allowedStepSize) { return volumeManagement; } NonMoneyManagement(final Volume volume); }
NonMoneyManagement implements MoneyManagement { @Override public Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice, final Price pipLostOnStopLoose, final Volume allowedStepSize) { return volumeManagement; } NonMoneyManagement(final Volume volume); @Override void updateExchangeRate(final ForexSymbol currencyExchange, final Price exchangeRate); @Override void updateBalance(final Money balance); @Override Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice,
            final Price pipLostOnStopLoose, final Volume allowedStepSize); }
NonMoneyManagement implements MoneyManagement { @Override public Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice, final Price pipLostOnStopLoose, final Volume allowedStepSize) { return volumeManagement; } NonMoneyManagement(final Volume volume); @Override void updateExchangeRate(final ForexSymbol currencyExchange, final Price exchangeRate); @Override void updateBalance(final Money balance); @Override Optional<UsedVolumeManagement> requestVolume(final ForexSymbol symbol, final Price currentPrice,
            final Price pipLostOnStopLoose, final Volume allowedStepSize);  }