forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_command.go
118 lines (104 loc) · 3.53 KB
/
fake_command.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/command"
"github.com/cloudfoundry/cli/cf/command_metadata"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/codegangsta/cli"
)
type FakeCommand struct {
MetadataStub func() command_metadata.CommandMetadata
metadataMutex sync.RWMutex
metadataArgsForCall []struct{}
metadataReturns struct {
result1 command_metadata.CommandMetadata
}
GetRequirementsStub func(requirementsFactory requirements.Factory, context *cli.Context) (reqs []requirements.Requirement, err error)
getRequirementsMutex sync.RWMutex
getRequirementsArgsForCall []struct {
requirementsFactory requirements.Factory
context *cli.Context
}
getRequirementsReturns struct {
result1 []requirements.Requirement
result2 error
}
RunStub func(context *cli.Context)
runMutex sync.RWMutex
runArgsForCall []struct {
context *cli.Context
}
}
func (fake *FakeCommand) Metadata() command_metadata.CommandMetadata {
fake.metadataMutex.Lock()
defer fake.metadataMutex.Unlock()
fake.metadataArgsForCall = append(fake.metadataArgsForCall, struct{}{})
if fake.MetadataStub != nil {
return fake.MetadataStub()
} else {
return fake.metadataReturns.result1
}
}
func (fake *FakeCommand) MetadataCallCount() int {
fake.metadataMutex.RLock()
defer fake.metadataMutex.RUnlock()
return len(fake.metadataArgsForCall)
}
func (fake *FakeCommand) MetadataReturns(result1 command_metadata.CommandMetadata) {
fake.MetadataStub = nil
fake.metadataReturns = struct {
result1 command_metadata.CommandMetadata
}{result1}
}
func (fake *FakeCommand) GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) (reqs []requirements.Requirement, err error) {
fake.getRequirementsMutex.Lock()
defer fake.getRequirementsMutex.Unlock()
fake.getRequirementsArgsForCall = append(fake.getRequirementsArgsForCall, struct {
requirementsFactory requirements.Factory
context *cli.Context
}{requirementsFactory, context})
if fake.GetRequirementsStub != nil {
return fake.GetRequirementsStub(requirementsFactory, context)
} else {
return fake.getRequirementsReturns.result1, fake.getRequirementsReturns.result2
}
}
func (fake *FakeCommand) GetRequirementsCallCount() int {
fake.getRequirementsMutex.RLock()
defer fake.getRequirementsMutex.RUnlock()
return len(fake.getRequirementsArgsForCall)
}
func (fake *FakeCommand) GetRequirementsArgsForCall(i int) (requirements.Factory, *cli.Context) {
fake.getRequirementsMutex.RLock()
defer fake.getRequirementsMutex.RUnlock()
return fake.getRequirementsArgsForCall[i].requirementsFactory, fake.getRequirementsArgsForCall[i].context
}
func (fake *FakeCommand) GetRequirementsReturns(result1 []requirements.Requirement, result2 error) {
fake.GetRequirementsStub = nil
fake.getRequirementsReturns = struct {
result1 []requirements.Requirement
result2 error
}{result1, result2}
}
func (fake *FakeCommand) Run(context *cli.Context) {
fake.runMutex.Lock()
defer fake.runMutex.Unlock()
fake.runArgsForCall = append(fake.runArgsForCall, struct {
context *cli.Context
}{context})
if fake.RunStub != nil {
fake.RunStub(context)
}
}
func (fake *FakeCommand) RunCallCount() int {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return len(fake.runArgsForCall)
}
func (fake *FakeCommand) RunArgsForCall(i int) *cli.Context {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return fake.runArgsForCall[i].context
}
var _ command.Command = new(FakeCommand)