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 825abc4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions session_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stretchr/testify/suite"

"github.com/quickfixgo/quickfix/config"
Expand All @@ -41,7 +44,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 +486,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 825abc4

Please sign in to comment.