-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_printer.go
129 lines (113 loc) · 3.19 KB
/
fake_printer.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
// This file was generated by counterfeiter
package tracefakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/trace"
)
type FakePrinter struct {
PrintStub func(v ...interface{})
printMutex sync.RWMutex
printArgsForCall []struct {
v []interface{}
}
PrintfStub func(format string, v ...interface{})
printfMutex sync.RWMutex
printfArgsForCall []struct {
format string
v []interface{}
}
PrintlnStub func(v ...interface{})
printlnMutex sync.RWMutex
printlnArgsForCall []struct {
v []interface{}
}
WritesToConsoleStub func() bool
writesToConsoleMutex sync.RWMutex
writesToConsoleArgsForCall []struct{}
writesToConsoleReturns struct {
result1 bool
}
}
func (fake *FakePrinter) Print(v ...interface{}) {
fake.printMutex.Lock()
fake.printArgsForCall = append(fake.printArgsForCall, struct {
v []interface{}
}{v})
fake.printMutex.Unlock()
if fake.PrintStub != nil {
fake.PrintStub(v...)
}
}
func (fake *FakePrinter) PrintCallCount() int {
fake.printMutex.RLock()
defer fake.printMutex.RUnlock()
return len(fake.printArgsForCall)
}
func (fake *FakePrinter) PrintArgsForCall(i int) []interface{} {
fake.printMutex.RLock()
defer fake.printMutex.RUnlock()
return fake.printArgsForCall[i].v
}
func (fake *FakePrinter) Printf(format string, v ...interface{}) {
fake.printfMutex.Lock()
fake.printfArgsForCall = append(fake.printfArgsForCall, struct {
format string
v []interface{}
}{format, v})
fake.printfMutex.Unlock()
if fake.PrintfStub != nil {
fake.PrintfStub(format, v...)
}
}
func (fake *FakePrinter) PrintfCallCount() int {
fake.printfMutex.RLock()
defer fake.printfMutex.RUnlock()
return len(fake.printfArgsForCall)
}
func (fake *FakePrinter) PrintfArgsForCall(i int) (string, []interface{}) {
fake.printfMutex.RLock()
defer fake.printfMutex.RUnlock()
return fake.printfArgsForCall[i].format, fake.printfArgsForCall[i].v
}
func (fake *FakePrinter) Println(v ...interface{}) {
fake.printlnMutex.Lock()
fake.printlnArgsForCall = append(fake.printlnArgsForCall, struct {
v []interface{}
}{v})
fake.printlnMutex.Unlock()
if fake.PrintlnStub != nil {
fake.PrintlnStub(v...)
}
}
func (fake *FakePrinter) PrintlnCallCount() int {
fake.printlnMutex.RLock()
defer fake.printlnMutex.RUnlock()
return len(fake.printlnArgsForCall)
}
func (fake *FakePrinter) PrintlnArgsForCall(i int) []interface{} {
fake.printlnMutex.RLock()
defer fake.printlnMutex.RUnlock()
return fake.printlnArgsForCall[i].v
}
func (fake *FakePrinter) WritesToConsole() bool {
fake.writesToConsoleMutex.Lock()
fake.writesToConsoleArgsForCall = append(fake.writesToConsoleArgsForCall, struct{}{})
fake.writesToConsoleMutex.Unlock()
if fake.WritesToConsoleStub != nil {
return fake.WritesToConsoleStub()
} else {
return fake.writesToConsoleReturns.result1
}
}
func (fake *FakePrinter) WritesToConsoleCallCount() int {
fake.writesToConsoleMutex.RLock()
defer fake.writesToConsoleMutex.RUnlock()
return len(fake.writesToConsoleArgsForCall)
}
func (fake *FakePrinter) WritesToConsoleReturns(result1 bool) {
fake.WritesToConsoleStub = nil
fake.writesToConsoleReturns = struct {
result1 bool
}{result1}
}
var _ trace.Printer = new(FakePrinter)