Skip to content

Commit

Permalink
Check AddFeatures return values in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sthelen-enqs committed Nov 29, 2024
1 parent f6c0bd8 commit 541ba0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion usecases/cs/lpc/testhelper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/enbility/spine-go/model"
"github.com/enbility/spine-go/spine"
"github.com/enbility/spine-go/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
)
Expand Down Expand Up @@ -76,7 +77,7 @@ func (s *CsLPCSuite) BeforeTest(suiteName, testName string) {

localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM)
s.sut = NewLPC(localEntity, s.Event)
_ = s.sut.AddFeatures()
assert.Nil(s.T(), s.sut.AddFeatures())
s.sut.AddUseCase()

s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer)
Expand Down
3 changes: 2 additions & 1 deletion usecases/cs/lpp/testhelper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/enbility/spine-go/model"
"github.com/enbility/spine-go/spine"
"github.com/enbility/spine-go/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
)
Expand Down Expand Up @@ -76,7 +77,7 @@ func (s *CsLPPSuite) BeforeTest(suiteName, testName string) {

localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM)
s.sut = NewLPP(localEntity, s.Event)
_ = s.sut.AddFeatures()
assert.Nil(s.T(), s.sut.AddFeatures())
s.sut.AddUseCase()

s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer)
Expand Down
6 changes: 4 additions & 2 deletions usecases/mu/mpc/testhelper_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package mpc

import (
"github.com/enbility/eebus-go/features/server"
"slices"
"time"

"github.com/enbility/eebus-go/features/server"

"github.com/enbility/eebus-go/api"
"github.com/enbility/eebus-go/mocks"
"github.com/enbility/eebus-go/service"
shipapi "github.com/enbility/ship-go/api"
"github.com/enbility/ship-go/cert"
spineapi "github.com/enbility/spine-go/api"
"github.com/enbility/spine-go/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
)
Expand Down Expand Up @@ -78,7 +80,7 @@ func (s *MuMPCSuite) BeforeTest(_, _ string) {
s.frequencyConfig,
)

_ = s.sut.AddFeatures()
assert.Nil(s.T(), s.sut.AddFeatures())
s.sut.AddUseCase()
}

Expand Down

0 comments on commit 541ba0a

Please sign in to comment.