Skip to content

Commit

Permalink
fixing failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
kcross-ctoken committed Dec 16, 2024
1 parent 685f691 commit fe84040
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions session_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
package quickfix

import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"time"

Expand All @@ -41,7 +43,7 @@ func TestSessionFactorySuite(t *testing.T) {
}

func (s *SessionFactorySuite) SetupTest() {
s.sessionFactory = sessionFactory{}
s.sessionFactory = sessionFactory{Registry: NewRegistry()}
s.SessionID = SessionID{BeginString: "FIX.4.2", TargetCompID: "TW", SenderCompID: "ISLD"}
s.MessageStoreFactory = NewMemoryStoreFactory()
s.SessionSettings = NewSessionSettings()
Expand Down Expand Up @@ -483,8 +485,9 @@ func (s *SessionFactorySuite) TestDuplicateSession() {
s.True(session.InitiateLogon)
_, err = s.createSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App)
s.NotNil(err)
s.Equal("Duplicate SessionID", err.Error())
s.UnregisterSession(s.SessionID)
assert.ErrorIs(s.T(), err, errDuplicateSessionID)
err = s.UnregisterSession(s.SessionID)
require.NoError(s.T(), err)
_, err = s.createSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App)
s.Nil(err)
}
Expand Down

0 comments on commit fe84040

Please sign in to comment.