-
Notifications
You must be signed in to change notification settings - Fork 14
/
mock.go
65 lines (46 loc) · 1.66 KB
/
mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package mock
import (
"github.com/latolukasz/beeorm"
"github.com/stretchr/testify/mock"
"github.com/coretrix/hitrix/pkg/entity"
"github.com/coretrix/hitrix/service/component/app"
"github.com/coretrix/hitrix/service/component/clock"
featureflag "github.com/coretrix/hitrix/service/component/feature_flag"
)
type FakeServiceFeatureFlag struct {
mock.Mock
}
func (s *FakeServiceFeatureFlag) IsActive(_ *beeorm.Engine, name string) bool {
called := s.Called(name)
return called.Bool(0)
}
func (s *FakeServiceFeatureFlag) FailIfIsNotActive(_ *beeorm.Engine, name string) error {
called := s.Called(name)
return called.Error(0)
}
func (s *FakeServiceFeatureFlag) Enable(_ *beeorm.Engine, name string) error {
called := s.Called(name)
return called.Error(0)
}
func (s *FakeServiceFeatureFlag) Disable(_ *beeorm.Engine, name string) error {
called := s.Called(name)
return called.Error(0)
}
func (s *FakeServiceFeatureFlag) GetAll(_ *beeorm.Engine, pager *beeorm.Pager) []*entity.FeatureFlagEntity {
called := s.Called(pager)
return called.Get(0).([]*entity.FeatureFlagEntity)
}
func (s *FakeServiceFeatureFlag) GetScriptsSingleInstance(ormService *beeorm.Engine) []app.IScript {
called := s.Called(ormService)
return called.Get(0).([]app.IScript)
}
func (s *FakeServiceFeatureFlag) GetScriptsMultiInstance(ormService *beeorm.Engine) []app.IScript {
called := s.Called(ormService)
return called.Get(0).([]app.IScript)
}
func (s *FakeServiceFeatureFlag) Register(featureFlags ...featureflag.IFeatureFlag) {
s.Called(featureFlags)
}
func (s *FakeServiceFeatureFlag) Sync(ormService *beeorm.Engine, clockService clock.IClock) {
s.Called(ormService, clockService)
}