github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/util/ui/uifakes/fake_config.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package uifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/util/configv3" 8 "code.cloudfoundry.org/cli/util/ui" 9 ) 10 11 type FakeConfig struct { 12 ColorEnabledStub func() configv3.ColorSetting 13 colorEnabledMutex sync.RWMutex 14 colorEnabledArgsForCall []struct { 15 } 16 colorEnabledReturns struct { 17 result1 configv3.ColorSetting 18 } 19 colorEnabledReturnsOnCall map[int]struct { 20 result1 configv3.ColorSetting 21 } 22 IsTTYStub func() bool 23 isTTYMutex sync.RWMutex 24 isTTYArgsForCall []struct { 25 } 26 isTTYReturns struct { 27 result1 bool 28 } 29 isTTYReturnsOnCall map[int]struct { 30 result1 bool 31 } 32 LocaleStub func() string 33 localeMutex sync.RWMutex 34 localeArgsForCall []struct { 35 } 36 localeReturns struct { 37 result1 string 38 } 39 localeReturnsOnCall map[int]struct { 40 result1 string 41 } 42 TerminalWidthStub func() int 43 terminalWidthMutex sync.RWMutex 44 terminalWidthArgsForCall []struct { 45 } 46 terminalWidthReturns struct { 47 result1 int 48 } 49 terminalWidthReturnsOnCall map[int]struct { 50 result1 int 51 } 52 invocations map[string][][]interface{} 53 invocationsMutex sync.RWMutex 54 } 55 56 func (fake *FakeConfig) ColorEnabled() configv3.ColorSetting { 57 fake.colorEnabledMutex.Lock() 58 ret, specificReturn := fake.colorEnabledReturnsOnCall[len(fake.colorEnabledArgsForCall)] 59 fake.colorEnabledArgsForCall = append(fake.colorEnabledArgsForCall, struct { 60 }{}) 61 stub := fake.ColorEnabledStub 62 fakeReturns := fake.colorEnabledReturns 63 fake.recordInvocation("ColorEnabled", []interface{}{}) 64 fake.colorEnabledMutex.Unlock() 65 if stub != nil { 66 return stub() 67 } 68 if specificReturn { 69 return ret.result1 70 } 71 return fakeReturns.result1 72 } 73 74 func (fake *FakeConfig) ColorEnabledCallCount() int { 75 fake.colorEnabledMutex.RLock() 76 defer fake.colorEnabledMutex.RUnlock() 77 return len(fake.colorEnabledArgsForCall) 78 } 79 80 func (fake *FakeConfig) ColorEnabledCalls(stub func() configv3.ColorSetting) { 81 fake.colorEnabledMutex.Lock() 82 defer fake.colorEnabledMutex.Unlock() 83 fake.ColorEnabledStub = stub 84 } 85 86 func (fake *FakeConfig) ColorEnabledReturns(result1 configv3.ColorSetting) { 87 fake.colorEnabledMutex.Lock() 88 defer fake.colorEnabledMutex.Unlock() 89 fake.ColorEnabledStub = nil 90 fake.colorEnabledReturns = struct { 91 result1 configv3.ColorSetting 92 }{result1} 93 } 94 95 func (fake *FakeConfig) ColorEnabledReturnsOnCall(i int, result1 configv3.ColorSetting) { 96 fake.colorEnabledMutex.Lock() 97 defer fake.colorEnabledMutex.Unlock() 98 fake.ColorEnabledStub = nil 99 if fake.colorEnabledReturnsOnCall == nil { 100 fake.colorEnabledReturnsOnCall = make(map[int]struct { 101 result1 configv3.ColorSetting 102 }) 103 } 104 fake.colorEnabledReturnsOnCall[i] = struct { 105 result1 configv3.ColorSetting 106 }{result1} 107 } 108 109 func (fake *FakeConfig) IsTTY() bool { 110 fake.isTTYMutex.Lock() 111 ret, specificReturn := fake.isTTYReturnsOnCall[len(fake.isTTYArgsForCall)] 112 fake.isTTYArgsForCall = append(fake.isTTYArgsForCall, struct { 113 }{}) 114 stub := fake.IsTTYStub 115 fakeReturns := fake.isTTYReturns 116 fake.recordInvocation("IsTTY", []interface{}{}) 117 fake.isTTYMutex.Unlock() 118 if stub != nil { 119 return stub() 120 } 121 if specificReturn { 122 return ret.result1 123 } 124 return fakeReturns.result1 125 } 126 127 func (fake *FakeConfig) IsTTYCallCount() int { 128 fake.isTTYMutex.RLock() 129 defer fake.isTTYMutex.RUnlock() 130 return len(fake.isTTYArgsForCall) 131 } 132 133 func (fake *FakeConfig) IsTTYCalls(stub func() bool) { 134 fake.isTTYMutex.Lock() 135 defer fake.isTTYMutex.Unlock() 136 fake.IsTTYStub = stub 137 } 138 139 func (fake *FakeConfig) IsTTYReturns(result1 bool) { 140 fake.isTTYMutex.Lock() 141 defer fake.isTTYMutex.Unlock() 142 fake.IsTTYStub = nil 143 fake.isTTYReturns = struct { 144 result1 bool 145 }{result1} 146 } 147 148 func (fake *FakeConfig) IsTTYReturnsOnCall(i int, result1 bool) { 149 fake.isTTYMutex.Lock() 150 defer fake.isTTYMutex.Unlock() 151 fake.IsTTYStub = nil 152 if fake.isTTYReturnsOnCall == nil { 153 fake.isTTYReturnsOnCall = make(map[int]struct { 154 result1 bool 155 }) 156 } 157 fake.isTTYReturnsOnCall[i] = struct { 158 result1 bool 159 }{result1} 160 } 161 162 func (fake *FakeConfig) Locale() string { 163 fake.localeMutex.Lock() 164 ret, specificReturn := fake.localeReturnsOnCall[len(fake.localeArgsForCall)] 165 fake.localeArgsForCall = append(fake.localeArgsForCall, struct { 166 }{}) 167 stub := fake.LocaleStub 168 fakeReturns := fake.localeReturns 169 fake.recordInvocation("Locale", []interface{}{}) 170 fake.localeMutex.Unlock() 171 if stub != nil { 172 return stub() 173 } 174 if specificReturn { 175 return ret.result1 176 } 177 return fakeReturns.result1 178 } 179 180 func (fake *FakeConfig) LocaleCallCount() int { 181 fake.localeMutex.RLock() 182 defer fake.localeMutex.RUnlock() 183 return len(fake.localeArgsForCall) 184 } 185 186 func (fake *FakeConfig) LocaleCalls(stub func() string) { 187 fake.localeMutex.Lock() 188 defer fake.localeMutex.Unlock() 189 fake.LocaleStub = stub 190 } 191 192 func (fake *FakeConfig) LocaleReturns(result1 string) { 193 fake.localeMutex.Lock() 194 defer fake.localeMutex.Unlock() 195 fake.LocaleStub = nil 196 fake.localeReturns = struct { 197 result1 string 198 }{result1} 199 } 200 201 func (fake *FakeConfig) LocaleReturnsOnCall(i int, result1 string) { 202 fake.localeMutex.Lock() 203 defer fake.localeMutex.Unlock() 204 fake.LocaleStub = nil 205 if fake.localeReturnsOnCall == nil { 206 fake.localeReturnsOnCall = make(map[int]struct { 207 result1 string 208 }) 209 } 210 fake.localeReturnsOnCall[i] = struct { 211 result1 string 212 }{result1} 213 } 214 215 func (fake *FakeConfig) TerminalWidth() int { 216 fake.terminalWidthMutex.Lock() 217 ret, specificReturn := fake.terminalWidthReturnsOnCall[len(fake.terminalWidthArgsForCall)] 218 fake.terminalWidthArgsForCall = append(fake.terminalWidthArgsForCall, struct { 219 }{}) 220 stub := fake.TerminalWidthStub 221 fakeReturns := fake.terminalWidthReturns 222 fake.recordInvocation("TerminalWidth", []interface{}{}) 223 fake.terminalWidthMutex.Unlock() 224 if stub != nil { 225 return stub() 226 } 227 if specificReturn { 228 return ret.result1 229 } 230 return fakeReturns.result1 231 } 232 233 func (fake *FakeConfig) TerminalWidthCallCount() int { 234 fake.terminalWidthMutex.RLock() 235 defer fake.terminalWidthMutex.RUnlock() 236 return len(fake.terminalWidthArgsForCall) 237 } 238 239 func (fake *FakeConfig) TerminalWidthCalls(stub func() int) { 240 fake.terminalWidthMutex.Lock() 241 defer fake.terminalWidthMutex.Unlock() 242 fake.TerminalWidthStub = stub 243 } 244 245 func (fake *FakeConfig) TerminalWidthReturns(result1 int) { 246 fake.terminalWidthMutex.Lock() 247 defer fake.terminalWidthMutex.Unlock() 248 fake.TerminalWidthStub = nil 249 fake.terminalWidthReturns = struct { 250 result1 int 251 }{result1} 252 } 253 254 func (fake *FakeConfig) TerminalWidthReturnsOnCall(i int, result1 int) { 255 fake.terminalWidthMutex.Lock() 256 defer fake.terminalWidthMutex.Unlock() 257 fake.TerminalWidthStub = nil 258 if fake.terminalWidthReturnsOnCall == nil { 259 fake.terminalWidthReturnsOnCall = make(map[int]struct { 260 result1 int 261 }) 262 } 263 fake.terminalWidthReturnsOnCall[i] = struct { 264 result1 int 265 }{result1} 266 } 267 268 func (fake *FakeConfig) Invocations() map[string][][]interface{} { 269 fake.invocationsMutex.RLock() 270 defer fake.invocationsMutex.RUnlock() 271 fake.colorEnabledMutex.RLock() 272 defer fake.colorEnabledMutex.RUnlock() 273 fake.isTTYMutex.RLock() 274 defer fake.isTTYMutex.RUnlock() 275 fake.localeMutex.RLock() 276 defer fake.localeMutex.RUnlock() 277 fake.terminalWidthMutex.RLock() 278 defer fake.terminalWidthMutex.RUnlock() 279 copiedInvocations := map[string][][]interface{}{} 280 for key, value := range fake.invocations { 281 copiedInvocations[key] = value 282 } 283 return copiedInvocations 284 } 285 286 func (fake *FakeConfig) recordInvocation(key string, args []interface{}) { 287 fake.invocationsMutex.Lock() 288 defer fake.invocationsMutex.Unlock() 289 if fake.invocations == nil { 290 fake.invocations = map[string][][]interface{}{} 291 } 292 if fake.invocations[key] == nil { 293 fake.invocations[key] = [][]interface{}{} 294 } 295 fake.invocations[key] = append(fake.invocations[key], args) 296 } 297 298 var _ ui.Config = new(FakeConfig)