From bb3e854d79346a9c77ea5592753e7833926625c0 Mon Sep 17 00:00:00 2001 From: Michael Ackley Date: Tue, 10 Sep 2024 15:58:21 -0500 Subject: [PATCH] Adds unit test --- logon_state_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/logon_state_test.go b/logon_state_test.go index 4fe952743..f5c871ea6 100644 --- a/logon_state_test.go +++ b/logon_state_test.go @@ -226,6 +226,27 @@ func (s *LogonStateTestSuite) TestFixMsgInLogonInitiateLogonExpectResetSeqNum() s.NextSenderMsgSeqNum(2) } +func (s *LogonStateTestSuite) TestFixMsgInLogonInitiateLogonRejectedSeqNumNotReset() { + s.session.InitiateLogon = true + s.session.sentReset = true + s.Require().Nil(s.store.IncrNextSenderMsgSeqNum()) + + logon := s.Logon() + logon.Body.SetField(tagHeartBtInt, FIXInt(32)) + logon.Body.SetField(tagResetSeqNumFlag, FIXBoolean(true)) + + s.MockApp.On("FromAdmin").Return(RejectLogon{"reject message"}) + s.MockApp.On("OnLogout") + s.MockApp.On("ToAdmin") + s.fixMsgIn(s.session, logon) + + s.MockApp.AssertExpectations(s.T()) + s.State(latentState{}) + + s.NextTargetMsgSeqNum(2) + s.NextSenderMsgSeqNum(3) +} + func (s *LogonStateTestSuite) TestFixMsgInLogonInitiateLogonUnExpectedResetSeqNum() { s.session.InitiateLogon = true s.session.sentReset = false