-
Notifications
You must be signed in to change notification settings - Fork 115
/
fake_windows_disk_linker.go
190 lines (172 loc) · 4.99 KB
/
fake_windows_disk_linker.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-agent/platform/windows/disk"
)
type FakeWindowsDiskLinker struct {
LinkStub func(string, string) error
linkMutex sync.RWMutex
linkArgsForCall []struct {
arg1 string
arg2 string
}
linkReturns struct {
result1 error
}
linkReturnsOnCall map[int]struct {
result1 error
}
LinkTargetStub func(string) (string, error)
linkTargetMutex sync.RWMutex
linkTargetArgsForCall []struct {
arg1 string
}
linkTargetReturns struct {
result1 string
result2 error
}
linkTargetReturnsOnCall map[int]struct {
result1 string
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeWindowsDiskLinker) Link(arg1 string, arg2 string) error {
fake.linkMutex.Lock()
ret, specificReturn := fake.linkReturnsOnCall[len(fake.linkArgsForCall)]
fake.linkArgsForCall = append(fake.linkArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
fake.recordInvocation("Link", []interface{}{arg1, arg2})
fake.linkMutex.Unlock()
if fake.LinkStub != nil {
return fake.LinkStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.linkReturns
return fakeReturns.result1
}
func (fake *FakeWindowsDiskLinker) LinkCallCount() int {
fake.linkMutex.RLock()
defer fake.linkMutex.RUnlock()
return len(fake.linkArgsForCall)
}
func (fake *FakeWindowsDiskLinker) LinkCalls(stub func(string, string) error) {
fake.linkMutex.Lock()
defer fake.linkMutex.Unlock()
fake.LinkStub = stub
}
func (fake *FakeWindowsDiskLinker) LinkArgsForCall(i int) (string, string) {
fake.linkMutex.RLock()
defer fake.linkMutex.RUnlock()
argsForCall := fake.linkArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeWindowsDiskLinker) LinkReturns(result1 error) {
fake.linkMutex.Lock()
defer fake.linkMutex.Unlock()
fake.LinkStub = nil
fake.linkReturns = struct {
result1 error
}{result1}
}
func (fake *FakeWindowsDiskLinker) LinkReturnsOnCall(i int, result1 error) {
fake.linkMutex.Lock()
defer fake.linkMutex.Unlock()
fake.LinkStub = nil
if fake.linkReturnsOnCall == nil {
fake.linkReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.linkReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeWindowsDiskLinker) LinkTarget(arg1 string) (string, error) {
fake.linkTargetMutex.Lock()
ret, specificReturn := fake.linkTargetReturnsOnCall[len(fake.linkTargetArgsForCall)]
fake.linkTargetArgsForCall = append(fake.linkTargetArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("LinkTarget", []interface{}{arg1})
fake.linkTargetMutex.Unlock()
if fake.LinkTargetStub != nil {
return fake.LinkTargetStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.linkTargetReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeWindowsDiskLinker) LinkTargetCallCount() int {
fake.linkTargetMutex.RLock()
defer fake.linkTargetMutex.RUnlock()
return len(fake.linkTargetArgsForCall)
}
func (fake *FakeWindowsDiskLinker) LinkTargetCalls(stub func(string) (string, error)) {
fake.linkTargetMutex.Lock()
defer fake.linkTargetMutex.Unlock()
fake.LinkTargetStub = stub
}
func (fake *FakeWindowsDiskLinker) LinkTargetArgsForCall(i int) string {
fake.linkTargetMutex.RLock()
defer fake.linkTargetMutex.RUnlock()
argsForCall := fake.linkTargetArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeWindowsDiskLinker) LinkTargetReturns(result1 string, result2 error) {
fake.linkTargetMutex.Lock()
defer fake.linkTargetMutex.Unlock()
fake.LinkTargetStub = nil
fake.linkTargetReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeWindowsDiskLinker) LinkTargetReturnsOnCall(i int, result1 string, result2 error) {
fake.linkTargetMutex.Lock()
defer fake.linkTargetMutex.Unlock()
fake.LinkTargetStub = nil
if fake.linkTargetReturnsOnCall == nil {
fake.linkTargetReturnsOnCall = make(map[int]struct {
result1 string
result2 error
})
}
fake.linkTargetReturnsOnCall[i] = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeWindowsDiskLinker) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.linkMutex.RLock()
defer fake.linkMutex.RUnlock()
fake.linkTargetMutex.RLock()
defer fake.linkTargetMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeWindowsDiskLinker) 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 _ disk.WindowsDiskLinker = new(FakeWindowsDiskLinker)