forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_stack_repository.go
130 lines (115 loc) · 3.5 KB
/
fake_stack_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
127
128
129
130
// This file was generated by counterfeiter
package stacksfakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api/stacks"
"github.com/cloudfoundry/cli/cf/models"
)
type FakeStackRepository struct {
FindByNameStub func(name string) (stack models.Stack, apiErr error)
findByNameMutex sync.RWMutex
findByNameArgsForCall []struct {
name string
}
findByNameReturns struct {
result1 models.Stack
result2 error
}
FindByGUIDStub func(guid string) (models.Stack, error)
findByGUIDMutex sync.RWMutex
findByGUIDArgsForCall []struct {
guid string
}
findByGUIDReturns struct {
result1 models.Stack
result2 error
}
FindAllStub func() (stacks []models.Stack, apiErr error)
findAllMutex sync.RWMutex
findAllArgsForCall []struct{}
findAllReturns struct {
result1 []models.Stack
result2 error
}
}
func (fake *FakeStackRepository) FindByName(name string) (stack models.Stack, apiErr error) {
fake.findByNameMutex.Lock()
fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
name string
}{name})
fake.findByNameMutex.Unlock()
if fake.FindByNameStub != nil {
return fake.FindByNameStub(name)
} else {
return fake.findByNameReturns.result1, fake.findByNameReturns.result2
}
}
func (fake *FakeStackRepository) FindByNameCallCount() int {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return len(fake.findByNameArgsForCall)
}
func (fake *FakeStackRepository) FindByNameArgsForCall(i int) string {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return fake.findByNameArgsForCall[i].name
}
func (fake *FakeStackRepository) FindByNameReturns(result1 models.Stack, result2 error) {
fake.FindByNameStub = nil
fake.findByNameReturns = struct {
result1 models.Stack
result2 error
}{result1, result2}
}
func (fake *FakeStackRepository) FindByGUID(guid string) (models.Stack, error) {
fake.findByGUIDMutex.Lock()
fake.findByGUIDArgsForCall = append(fake.findByGUIDArgsForCall, struct {
guid string
}{guid})
fake.findByGUIDMutex.Unlock()
if fake.FindByGUIDStub != nil {
return fake.FindByGUIDStub(guid)
} else {
return fake.findByGUIDReturns.result1, fake.findByGUIDReturns.result2
}
}
func (fake *FakeStackRepository) FindByGUIDCallCount() int {
fake.findByGUIDMutex.RLock()
defer fake.findByGUIDMutex.RUnlock()
return len(fake.findByGUIDArgsForCall)
}
func (fake *FakeStackRepository) FindByGUIDArgsForCall(i int) string {
fake.findByGUIDMutex.RLock()
defer fake.findByGUIDMutex.RUnlock()
return fake.findByGUIDArgsForCall[i].guid
}
func (fake *FakeStackRepository) FindByGUIDReturns(result1 models.Stack, result2 error) {
fake.FindByGUIDStub = nil
fake.findByGUIDReturns = struct {
result1 models.Stack
result2 error
}{result1, result2}
}
func (fake *FakeStackRepository) FindAll() (stacks []models.Stack, apiErr error) {
fake.findAllMutex.Lock()
fake.findAllArgsForCall = append(fake.findAllArgsForCall, struct{}{})
fake.findAllMutex.Unlock()
if fake.FindAllStub != nil {
return fake.FindAllStub()
} else {
return fake.findAllReturns.result1, fake.findAllReturns.result2
}
}
func (fake *FakeStackRepository) FindAllCallCount() int {
fake.findAllMutex.RLock()
defer fake.findAllMutex.RUnlock()
return len(fake.findAllArgsForCall)
}
func (fake *FakeStackRepository) FindAllReturns(result1 []models.Stack, result2 error) {
fake.FindAllStub = nil
fake.findAllReturns = struct {
result1 []models.Stack
result2 error
}{result1, result2}
}
var _ stacks.StackRepository = new(FakeStackRepository)