@@ -19,6 +19,9 @@ import (
19
19
"testing"
20
20
"time"
21
21
22
+ "github.com/stretchr/testify/assert"
23
+ "github.com/stretchr/testify/require"
24
+
22
25
"github.com/stretchr/testify/suite"
23
26
24
27
"github.com/quickfixgo/quickfix/config"
@@ -41,7 +44,7 @@ func TestSessionFactorySuite(t *testing.T) {
41
44
}
42
45
43
46
func (s * SessionFactorySuite ) SetupTest () {
44
- s .sessionFactory = sessionFactory {}
47
+ s .sessionFactory = sessionFactory {Registry : NewRegistry () }
45
48
s .SessionID = SessionID {BeginString : "FIX.4.2" , TargetCompID : "TW" , SenderCompID : "ISLD" }
46
49
s .MessageStoreFactory = NewMemoryStoreFactory ()
47
50
s .SessionSettings = NewSessionSettings ()
@@ -483,8 +486,9 @@ func (s *SessionFactorySuite) TestDuplicateSession() {
483
486
s .True (session .InitiateLogon )
484
487
_ , err = s .createSession (s .SessionID , s .MessageStoreFactory , s .SessionSettings , s .LogFactory , s .App )
485
488
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 )
488
492
_ , err = s .createSession (s .SessionID , s .MessageStoreFactory , s .SessionSettings , s .LogFactory , s .App )
489
493
s .Nil (err )
490
494
}
0 commit comments