forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_random_word_generator.go
139 lines (125 loc) · 3.94 KB
/
fake_random_word_generator.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
131
132
133
134
135
136
137
138
139
// Code generated by counterfeiter. DO NOT EDIT.
package pushactionfakes
import (
"sync"
"code.cloudfoundry.org/cli/actor/pushaction"
)
type FakeRandomWordGenerator struct {
RandomAdjectiveStub func() string
randomAdjectiveMutex sync.RWMutex
randomAdjectiveArgsForCall []struct{}
randomAdjectiveReturns struct {
result1 string
}
randomAdjectiveReturnsOnCall map[int]struct {
result1 string
}
RandomNounStub func() string
randomNounMutex sync.RWMutex
randomNounArgsForCall []struct{}
randomNounReturns struct {
result1 string
}
randomNounReturnsOnCall map[int]struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeRandomWordGenerator) RandomAdjective() string {
fake.randomAdjectiveMutex.Lock()
ret, specificReturn := fake.randomAdjectiveReturnsOnCall[len(fake.randomAdjectiveArgsForCall)]
fake.randomAdjectiveArgsForCall = append(fake.randomAdjectiveArgsForCall, struct{}{})
fake.recordInvocation("RandomAdjective", []interface{}{})
fake.randomAdjectiveMutex.Unlock()
if fake.RandomAdjectiveStub != nil {
return fake.RandomAdjectiveStub()
}
if specificReturn {
return ret.result1
}
return fake.randomAdjectiveReturns.result1
}
func (fake *FakeRandomWordGenerator) RandomAdjectiveCallCount() int {
fake.randomAdjectiveMutex.RLock()
defer fake.randomAdjectiveMutex.RUnlock()
return len(fake.randomAdjectiveArgsForCall)
}
func (fake *FakeRandomWordGenerator) RandomAdjectiveReturns(result1 string) {
fake.RandomAdjectiveStub = nil
fake.randomAdjectiveReturns = struct {
result1 string
}{result1}
}
func (fake *FakeRandomWordGenerator) RandomAdjectiveReturnsOnCall(i int, result1 string) {
fake.RandomAdjectiveStub = nil
if fake.randomAdjectiveReturnsOnCall == nil {
fake.randomAdjectiveReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.randomAdjectiveReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeRandomWordGenerator) RandomNoun() string {
fake.randomNounMutex.Lock()
ret, specificReturn := fake.randomNounReturnsOnCall[len(fake.randomNounArgsForCall)]
fake.randomNounArgsForCall = append(fake.randomNounArgsForCall, struct{}{})
fake.recordInvocation("RandomNoun", []interface{}{})
fake.randomNounMutex.Unlock()
if fake.RandomNounStub != nil {
return fake.RandomNounStub()
}
if specificReturn {
return ret.result1
}
return fake.randomNounReturns.result1
}
func (fake *FakeRandomWordGenerator) RandomNounCallCount() int {
fake.randomNounMutex.RLock()
defer fake.randomNounMutex.RUnlock()
return len(fake.randomNounArgsForCall)
}
func (fake *FakeRandomWordGenerator) RandomNounReturns(result1 string) {
fake.RandomNounStub = nil
fake.randomNounReturns = struct {
result1 string
}{result1}
}
func (fake *FakeRandomWordGenerator) RandomNounReturnsOnCall(i int, result1 string) {
fake.RandomNounStub = nil
if fake.randomNounReturnsOnCall == nil {
fake.randomNounReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.randomNounReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeRandomWordGenerator) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.randomAdjectiveMutex.RLock()
defer fake.randomAdjectiveMutex.RUnlock()
fake.randomNounMutex.RLock()
defer fake.randomNounMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeRandomWordGenerator) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ pushaction.RandomWordGenerator = new(FakeRandomWordGenerator)