public void testUpdated() { mSecStatusListener = new MamdaSecurityStatusListener(); mSubscription.addMsgListener(mSecStatusListener); mMsg = new MamaMsg(); addMamaHeaderFields(mMsg, (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS, (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK, (uint)1); mMsg.addChar(null, 5248, 'C'); callMamdaOnMsg(mSubscription, mMsg); Assert.AreEqual('C', mSecStatusListener.getShortSaleCircuitBreaker()); Assert.AreEqual(MamdaFieldState.MODIFIED, mSecStatusListener.getShortSaleCircuitBreakerFieldState()); mMsg = null; mMsg = new MamaMsg(); addMamaHeaderFields(mMsg, (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS, (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK, (uint)2); callMamdaOnMsg(mSubscription, mMsg); Assert.AreEqual(MamdaFieldState.NOT_MODIFIED, mSecStatusListener.getShortSaleCircuitBreakerFieldState()); mMsg = null; mMsg = new MamaMsg(); addMamaHeaderFields(mMsg, (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS, (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK, (uint)3); mMsg.addChar(null, 5248, 'D'); callMamdaOnMsg(mSubscription, mMsg); Assert.AreEqual('D', mSecStatusListener.getShortSaleCircuitBreaker()); Assert.AreEqual(MamdaFieldState.MODIFIED, mSecStatusListener.getShortSaleCircuitBreakerFieldState()); mMsg = null; mSecStatusListener = null; }
public void testNotInEffect() { mSecStatusListener = new MamdaSecurityStatusListener(); mSubscription.addMsgListener(mSecStatusListener); mMsg = new MamaMsg(); addMamaHeaderFields(mMsg, (byte)mamaMsgType.MAMA_MSG_TYPE_SEC_STATUS, (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK, (uint)1); callMamdaOnMsg(mSubscription, mMsg); Assert.AreEqual(' ', mSecStatusListener.getShortSaleCircuitBreaker()); Assert.AreEqual(MamdaFieldState.NOT_INITIALISED, mSecStatusListener.getShortSaleCircuitBreakerFieldState()); mMsg = null; mSecStatusListener = null; }