forked from cloudfoundry/executor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fake_step.go
61 lines (52 loc) · 1.32 KB
/
fake_step.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry-incubator/executor/depot/steps"
)
type FakeStep struct {
PerformStub func() error
performMutex sync.RWMutex
performArgsForCall []struct{}
performReturns struct {
result1 error
}
CancelStub func()
cancelMutex sync.RWMutex
cancelArgsForCall []struct{}
}
func (fake *FakeStep) Perform() error {
fake.performMutex.Lock()
fake.performArgsForCall = append(fake.performArgsForCall, struct{}{})
fake.performMutex.Unlock()
if fake.PerformStub != nil {
return fake.PerformStub()
} else {
return fake.performReturns.result1
}
}
func (fake *FakeStep) PerformCallCount() int {
fake.performMutex.RLock()
defer fake.performMutex.RUnlock()
return len(fake.performArgsForCall)
}
func (fake *FakeStep) PerformReturns(result1 error) {
fake.PerformStub = nil
fake.performReturns = struct {
result1 error
}{result1}
}
func (fake *FakeStep) Cancel() {
fake.cancelMutex.Lock()
fake.cancelArgsForCall = append(fake.cancelArgsForCall, struct{}{})
fake.cancelMutex.Unlock()
if fake.CancelStub != nil {
fake.CancelStub()
}
}
func (fake *FakeStep) CancelCallCount() int {
fake.cancelMutex.RLock()
defer fake.cancelMutex.RUnlock()
return len(fake.cancelArgsForCall)
}
var _ steps.Step = new(FakeStep)