@@ -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
4346func  (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