forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_cli_connection.go
95 lines (83 loc) · 2.92 KB
/
fake_cli_connection.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
. "github.com/cloudfoundry/cli/plugin"
)
type FakeCliConnection struct {
CliCommandWithoutTerminalOutputStub func(args ...string) ([]string, error)
cliCommandWithoutTerminalOutputMutex sync.RWMutex
cliCommandWithoutTerminalOutputArgsForCall []struct {
args []string
}
cliCommandWithoutTerminalOutputReturns struct {
result1 []string
result2 error
}
CliCommandStub func(args ...string) ([]string, error)
cliCommandMutex sync.RWMutex
cliCommandArgsForCall []struct {
args []string
}
cliCommandReturns struct {
result1 []string
result2 error
}
}
func (fake *FakeCliConnection) CliCommandWithoutTerminalOutput(args ...string) ([]string, error) {
fake.cliCommandWithoutTerminalOutputMutex.Lock()
defer fake.cliCommandWithoutTerminalOutputMutex.Unlock()
fake.cliCommandWithoutTerminalOutputArgsForCall = append(fake.cliCommandWithoutTerminalOutputArgsForCall, struct {
args []string
}{args})
if fake.CliCommandWithoutTerminalOutputStub != nil {
return fake.CliCommandWithoutTerminalOutputStub(args...)
} else {
return fake.cliCommandWithoutTerminalOutputReturns.result1, fake.cliCommandWithoutTerminalOutputReturns.result2
}
}
func (fake *FakeCliConnection) CliCommandWithoutTerminalOutputCallCount() int {
fake.cliCommandWithoutTerminalOutputMutex.RLock()
defer fake.cliCommandWithoutTerminalOutputMutex.RUnlock()
return len(fake.cliCommandWithoutTerminalOutputArgsForCall)
}
func (fake *FakeCliConnection) CliCommandWithoutTerminalOutputArgsForCall(i int) []string {
fake.cliCommandWithoutTerminalOutputMutex.RLock()
defer fake.cliCommandWithoutTerminalOutputMutex.RUnlock()
return fake.cliCommandWithoutTerminalOutputArgsForCall[i].args
}
func (fake *FakeCliConnection) CliCommandWithoutTerminalOutputReturns(result1 []string, result2 error) {
fake.cliCommandWithoutTerminalOutputReturns = struct {
result1 []string
result2 error
}{result1, result2}
}
func (fake *FakeCliConnection) CliCommand(args ...string) ([]string, error) {
fake.cliCommandMutex.Lock()
defer fake.cliCommandMutex.Unlock()
fake.cliCommandArgsForCall = append(fake.cliCommandArgsForCall, struct {
args []string
}{args})
if fake.CliCommandStub != nil {
return fake.CliCommandStub(args...)
} else {
return fake.cliCommandReturns.result1, fake.cliCommandReturns.result2
}
}
func (fake *FakeCliConnection) CliCommandCallCount() int {
fake.cliCommandMutex.RLock()
defer fake.cliCommandMutex.RUnlock()
return len(fake.cliCommandArgsForCall)
}
func (fake *FakeCliConnection) CliCommandArgsForCall(i int) []string {
fake.cliCommandMutex.RLock()
defer fake.cliCommandMutex.RUnlock()
return fake.cliCommandArgsForCall[i].args
}
func (fake *FakeCliConnection) CliCommandReturns(result1 []string, result2 error) {
fake.cliCommandReturns = struct {
result1 []string
result2 error
}{result1, result2}
}
var _ CliConnection = new(FakeCliConnection)