-
Notifications
You must be signed in to change notification settings - Fork 162
/
fake_release_repo.go
84 lines (73 loc) · 2.03 KB
/
fake_release_repo.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
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/config"
"github.com/cloudfoundry/bosh-cli/release"
)
// FakeReleaseRepo was generated by counterfeiter
type FakeReleaseRepo struct {
ListStub func() ([]config.ReleaseRecord, error)
listMutex sync.RWMutex
listArgsForCall []struct{}
listReturns struct {
result1 []config.ReleaseRecord
result2 error
}
UpdateStub func([]release.Release) error
updateMutex sync.RWMutex
updateArgsForCall []struct {
arg1 []release.Release
}
updateReturns struct {
result1 error
}
}
func (fake *FakeReleaseRepo) List() ([]config.ReleaseRecord, error) {
fake.listMutex.Lock()
fake.listArgsForCall = append(fake.listArgsForCall, struct{}{})
fake.listMutex.Unlock()
if fake.ListStub != nil {
return fake.ListStub()
}
return fake.listReturns.result1, fake.listReturns.result2
}
func (fake *FakeReleaseRepo) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *FakeReleaseRepo) ListReturns(result1 []config.ReleaseRecord, result2 error) {
fake.ListStub = nil
fake.listReturns = struct {
result1 []config.ReleaseRecord
result2 error
}{result1, result2}
}
func (fake *FakeReleaseRepo) Update(arg1 []release.Release) error {
fake.updateMutex.Lock()
fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
arg1 []release.Release
}{arg1})
fake.updateMutex.Unlock()
if fake.UpdateStub != nil {
return fake.UpdateStub(arg1)
}
return fake.updateReturns.result1
}
func (fake *FakeReleaseRepo) UpdateCallCount() int {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return len(fake.updateArgsForCall)
}
func (fake *FakeReleaseRepo) UpdateArgsForCall(i int) []release.Release {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return fake.updateArgsForCall[i].arg1
}
func (fake *FakeReleaseRepo) UpdateReturns(result1 error) {
fake.UpdateStub = nil
fake.updateReturns = struct {
result1 error
}{result1}
}
var _ config.ReleaseRepo = new(FakeReleaseRepo)