public class LocalExpertAdvisorTest extends Object
LocalExpertAdvisor works as expected.| Constructor and Description |
|---|
LocalExpertAdvisorTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
setUpMocksAndCut()
Sets up the default behavior of the mocks.
|
void |
shouldFailWhenUnknownOrderWasClosed()
When a
PendingOrderConditionalyClosedMessage message was received for an unknown PendingOrder a
ProtocolException should be thrown. |
void |
shouldFailWhenUnknownOrderWasOpened()
When a
PendingOrderConditionalyExecutedMessage message was received for an unknown PendingOrder a
ProtocolException should be thrown. |
void |
shouldFailWithAProtcolExceptionWhenUnexpectedMessageWasReceived()
When the
MessageBasedClientConnection read a message that was not expected to be read for the
ExpertAdvisorProtocol, a ProtocolException should be thrown. |
void |
shouldInformBalanceManagerOnChangedBalance()
When a
BalanceChangedMessage was received the expert advisor should be notified. |
void |
shouldInformExpertAdvisorOnClosedPendingOrders()
When a pending order was closed because it's closing conditions are met, the
ExpertAdvisor should be
notified. |
void |
shouldInformExpertAdvisorOnNewMarketData()
When a
NewMarketDataExtendedMessage was received the expert advisor should be notified. |
void |
shouldInformExpertAdvisorOnOpenedPendingOrders()
When a pending order was opened the
ExpertAdvisor should be notified. |
void |
shouldInformTheBalanceManagerOnAccountCurrencyExchangeRateChanged()
When a
AccountCurrencyExchangeRateChangedMessage was received the expert advisor should be notified. |
void |
shoulRemoveClosedPendingOrdersFromTheMapping()
To prevent memory leaks, closed
PendingOrders should be removed from the order-to-id mapping. |
public void setUpMocksAndCut()
public void shouldFailWithAProtcolExceptionWhenUnexpectedMessageWasReceived()
throws de.voidnode.trading4j.server.protocol.CommunicationException
MessageBasedClientConnection read a message that was not expected to be read for the
ExpertAdvisorProtocol, a ProtocolException should be thrown.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformExpertAdvisorOnNewMarketData()
throws de.voidnode.trading4j.server.protocol.CommunicationException
NewMarketDataExtendedMessage was received the expert advisor should be notified.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformBalanceManagerOnChangedBalance()
throws de.voidnode.trading4j.server.protocol.CommunicationException
BalanceChangedMessage was received the expert advisor should be notified.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformTheBalanceManagerOnAccountCurrencyExchangeRateChanged()
throws de.voidnode.trading4j.server.protocol.CommunicationException
AccountCurrencyExchangeRateChangedMessage was received the expert advisor should be notified.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformExpertAdvisorOnOpenedPendingOrders()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor should be notified.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldFailWhenUnknownOrderWasOpened()
throws de.voidnode.trading4j.server.protocol.CommunicationException
PendingOrderConditionalyExecutedMessage message was received for an unknown PendingOrder a
ProtocolException should be thrown.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldInformExpertAdvisorOnClosedPendingOrders()
throws de.voidnode.trading4j.server.protocol.CommunicationException
ExpertAdvisor should be
notified.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shouldFailWhenUnknownOrderWasClosed()
throws de.voidnode.trading4j.server.protocol.CommunicationException
PendingOrderConditionalyClosedMessage message was received for an unknown PendingOrder a
ProtocolException should be thrown.de.voidnode.trading4j.server.protocol.CommunicationException - not expected to leave the test.public void shoulRemoveClosedPendingOrdersFromTheMapping()
throws de.voidnode.trading4j.server.protocol.ProtocolException
PendingOrders should be removed from the order-to-id mapping.de.voidnode.trading4j.server.protocol.ProtocolException - not expected to leave the test.Copyright © 2016. All rights reserved.