forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_feature_flag_repository.go
126 lines (112 loc) · 3.33 KB
/
fake_feature_flag_repository.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// This file was generated by counterfeiter
package fakes
import (
. "github.com/cloudfoundry/cli/cf/api/feature_flags"
"github.com/cloudfoundry/cli/cf/models"
"sync"
)
type FakeFeatureFlagRepository struct {
ListStub func() ([]models.FeatureFlag, error)
listMutex sync.RWMutex
listArgsForCall []struct{}
listReturns struct {
result1 []models.FeatureFlag
result2 error
}
FindByNameStub func(string) (models.FeatureFlag, error)
findByNameMutex sync.RWMutex
findByNameArgsForCall []struct {
arg1 string
}
findByNameReturns struct {
result1 models.FeatureFlag
result2 error
}
UpdateStub func(string, bool) error
updateMutex sync.RWMutex
updateArgsForCall []struct {
arg1 string
arg2 bool
}
updateReturns struct {
result1 error
}
}
func (fake *FakeFeatureFlagRepository) List() ([]models.FeatureFlag, error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.listArgsForCall = append(fake.listArgsForCall, struct{}{})
if fake.ListStub != nil {
return fake.ListStub()
} else {
return fake.listReturns.result1, fake.listReturns.result2
}
}
func (fake *FakeFeatureFlagRepository) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *FakeFeatureFlagRepository) ListReturns(result1 []models.FeatureFlag, result2 error) {
fake.listReturns = struct {
result1 []models.FeatureFlag
result2 error
}{result1, result2}
}
func (fake *FakeFeatureFlagRepository) FindByName(arg1 string) (models.FeatureFlag, error) {
fake.findByNameMutex.Lock()
defer fake.findByNameMutex.Unlock()
fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
arg1 string
}{arg1})
if fake.FindByNameStub != nil {
return fake.FindByNameStub(arg1)
} else {
return fake.findByNameReturns.result1, fake.findByNameReturns.result2
}
}
func (fake *FakeFeatureFlagRepository) FindByNameCallCount() int {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return len(fake.findByNameArgsForCall)
}
func (fake *FakeFeatureFlagRepository) FindByNameArgsForCall(i int) string {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return fake.findByNameArgsForCall[i].arg1
}
func (fake *FakeFeatureFlagRepository) FindByNameReturns(result1 models.FeatureFlag, result2 error) {
fake.findByNameReturns = struct {
result1 models.FeatureFlag
result2 error
}{result1, result2}
}
func (fake *FakeFeatureFlagRepository) Update(arg1 string, arg2 bool) error {
fake.updateMutex.Lock()
defer fake.updateMutex.Unlock()
fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
arg1 string
arg2 bool
}{arg1, arg2})
if fake.UpdateStub != nil {
return fake.UpdateStub(arg1, arg2)
} else {
return fake.updateReturns.result1
}
}
func (fake *FakeFeatureFlagRepository) UpdateCallCount() int {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return len(fake.updateArgsForCall)
}
func (fake *FakeFeatureFlagRepository) UpdateArgsForCall(i int) (string, bool) {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return fake.updateArgsForCall[i].arg1, fake.updateArgsForCall[i].arg2
}
func (fake *FakeFeatureFlagRepository) UpdateReturns(result1 error) {
fake.updateReturns = struct {
result1 error
}{result1}
}
var _ FeatureFlagRepository = new(FakeFeatureFlagRepository)