Skip to content

Commit

Permalink
Adds unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ackleymi committed Sep 10, 2024
1 parent f1f8c0e commit bb3e854
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions logon_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb3e854

Please sign in to comment.