Skip to content

Commit 541ba0a

Browse files
committed
Check AddFeatures return values in tests
1 parent f6c0bd8 commit 541ba0a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

usecases/cs/lpc/testhelper_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/enbility/spine-go/model"
1717
"github.com/enbility/spine-go/spine"
1818
"github.com/enbility/spine-go/util"
19+
"github.com/stretchr/testify/assert"
1920
"github.com/stretchr/testify/mock"
2021
"github.com/stretchr/testify/suite"
2122
)
@@ -76,7 +77,7 @@ func (s *CsLPCSuite) BeforeTest(suiteName, testName string) {
7677

7778
localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM)
7879
s.sut = NewLPC(localEntity, s.Event)
79-
_ = s.sut.AddFeatures()
80+
assert.Nil(s.T(), s.sut.AddFeatures())
8081
s.sut.AddUseCase()
8182

8283
s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer)

usecases/cs/lpp/testhelper_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/enbility/spine-go/model"
1717
"github.com/enbility/spine-go/spine"
1818
"github.com/enbility/spine-go/util"
19+
"github.com/stretchr/testify/assert"
1920
"github.com/stretchr/testify/mock"
2021
"github.com/stretchr/testify/suite"
2122
)
@@ -76,7 +77,7 @@ func (s *CsLPPSuite) BeforeTest(suiteName, testName string) {
7677

7778
localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM)
7879
s.sut = NewLPP(localEntity, s.Event)
79-
_ = s.sut.AddFeatures()
80+
assert.Nil(s.T(), s.sut.AddFeatures())
8081
s.sut.AddUseCase()
8182

8283
s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer)

usecases/mu/mpc/testhelper_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
package mpc
22

33
import (
4-
"github.com/enbility/eebus-go/features/server"
54
"slices"
65
"time"
76

7+
"github.com/enbility/eebus-go/features/server"
8+
89
"github.com/enbility/eebus-go/api"
910
"github.com/enbility/eebus-go/mocks"
1011
"github.com/enbility/eebus-go/service"
1112
shipapi "github.com/enbility/ship-go/api"
1213
"github.com/enbility/ship-go/cert"
1314
spineapi "github.com/enbility/spine-go/api"
1415
"github.com/enbility/spine-go/model"
16+
"github.com/stretchr/testify/assert"
1517
"github.com/stretchr/testify/mock"
1618
"github.com/stretchr/testify/suite"
1719
)
@@ -78,7 +80,7 @@ func (s *MuMPCSuite) BeforeTest(_, _ string) {
7880
s.frequencyConfig,
7981
)
8082

81-
_ = s.sut.AddFeatures()
83+
assert.Nil(s.T(), s.sut.AddFeatures())
8284
s.sut.AddUseCase()
8385
}
8486

0 commit comments

Comments
 (0)