github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/util/ui/uifakes/fake_config.go (about) 1 // This file was generated by counterfeiter 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 colorEnabledReturns struct { 16 result1 configv3.ColorSetting 17 } 18 LocaleStub func() string 19 localeMutex sync.RWMutex 20 localeArgsForCall []struct{} 21 localeReturns struct { 22 result1 string 23 } 24 invocations map[string][][]interface{} 25 invocationsMutex sync.RWMutex 26 } 27 28 func (fake *FakeConfig) ColorEnabled() configv3.ColorSetting { 29 fake.colorEnabledMutex.Lock() 30 fake.colorEnabledArgsForCall = append(fake.colorEnabledArgsForCall, struct{}{}) 31 fake.recordInvocation("ColorEnabled", []interface{}{}) 32 fake.colorEnabledMutex.Unlock() 33 if fake.ColorEnabledStub != nil { 34 return fake.ColorEnabledStub() 35 } else { 36 return fake.colorEnabledReturns.result1 37 } 38 } 39 40 func (fake *FakeConfig) ColorEnabledCallCount() int { 41 fake.colorEnabledMutex.RLock() 42 defer fake.colorEnabledMutex.RUnlock() 43 return len(fake.colorEnabledArgsForCall) 44 } 45 46 func (fake *FakeConfig) ColorEnabledReturns(result1 configv3.ColorSetting) { 47 fake.ColorEnabledStub = nil 48 fake.colorEnabledReturns = struct { 49 result1 configv3.ColorSetting 50 }{result1} 51 } 52 53 func (fake *FakeConfig) Locale() string { 54 fake.localeMutex.Lock() 55 fake.localeArgsForCall = append(fake.localeArgsForCall, struct{}{}) 56 fake.recordInvocation("Locale", []interface{}{}) 57 fake.localeMutex.Unlock() 58 if fake.LocaleStub != nil { 59 return fake.LocaleStub() 60 } else { 61 return fake.localeReturns.result1 62 } 63 } 64 65 func (fake *FakeConfig) LocaleCallCount() int { 66 fake.localeMutex.RLock() 67 defer fake.localeMutex.RUnlock() 68 return len(fake.localeArgsForCall) 69 } 70 71 func (fake *FakeConfig) LocaleReturns(result1 string) { 72 fake.LocaleStub = nil 73 fake.localeReturns = struct { 74 result1 string 75 }{result1} 76 } 77 78 func (fake *FakeConfig) Invocations() map[string][][]interface{} { 79 fake.invocationsMutex.RLock() 80 defer fake.invocationsMutex.RUnlock() 81 fake.colorEnabledMutex.RLock() 82 defer fake.colorEnabledMutex.RUnlock() 83 fake.localeMutex.RLock() 84 defer fake.localeMutex.RUnlock() 85 return fake.invocations 86 } 87 88 func (fake *FakeConfig) recordInvocation(key string, args []interface{}) { 89 fake.invocationsMutex.Lock() 90 defer fake.invocationsMutex.Unlock() 91 if fake.invocations == nil { 92 fake.invocations = map[string][][]interface{}{} 93 } 94 if fake.invocations[key] == nil { 95 fake.invocations[key] = [][]interface{}{} 96 } 97 fake.invocations[key] = append(fake.invocations[key], args) 98 } 99 100 var _ ui.Config = new(FakeConfig)