Skip to content

Commit 825abc4

Browse files
committed
fixing failing test
1 parent 685f691 commit 825abc4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: session_factory_test.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import (
1919
"testing"
2020
"time"
2121

22+
"github.com/stretchr/testify/assert"
23+
"github.com/stretchr/testify/require"
24+
2225
"github.com/stretchr/testify/suite"
2326

2427
"github.com/quickfixgo/quickfix/config"
@@ -41,7 +44,7 @@ func TestSessionFactorySuite(t *testing.T) {
4144
}
4245

4346
func (s *SessionFactorySuite) SetupTest() {
44-
s.sessionFactory = sessionFactory{}
47+
s.sessionFactory = sessionFactory{Registry: NewRegistry()}
4548
s.SessionID = SessionID{BeginString: "FIX.4.2", TargetCompID: "TW", SenderCompID: "ISLD"}
4649
s.MessageStoreFactory = NewMemoryStoreFactory()
4750
s.SessionSettings = NewSessionSettings()
@@ -483,8 +486,9 @@ func (s *SessionFactorySuite) TestDuplicateSession() {
483486
s.True(session.InitiateLogon)
484487
_, err = s.createSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App)
485488
s.NotNil(err)
486-
s.Equal("Duplicate SessionID", err.Error())
487-
s.UnregisterSession(s.SessionID)
489+
assert.ErrorIs(s.T(), err, errDuplicateSessionID)
490+
err = s.UnregisterSession(s.SessionID)
491+
require.NoError(s.T(), err)
488492
_, err = s.createSession(s.SessionID, s.MessageStoreFactory, s.SessionSettings, s.LogFactory, s.App)
489493
s.Nil(err)
490494
}

0 commit comments

Comments
 (0)