github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/command/common/commonfakes/fake_help_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package commonfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/sharedaction" 8 "code.cloudfoundry.org/cli/command/common" 9 ) 10 11 type FakeHelpActor struct { 12 CommandInfoByNameStub func(interface{}, string) (sharedaction.CommandInfo, error) 13 commandInfoByNameMutex sync.RWMutex 14 commandInfoByNameArgsForCall []struct { 15 arg1 interface{} 16 arg2 string 17 } 18 commandInfoByNameReturns struct { 19 result1 sharedaction.CommandInfo 20 result2 error 21 } 22 commandInfoByNameReturnsOnCall map[int]struct { 23 result1 sharedaction.CommandInfo 24 result2 error 25 } 26 CommandInfosStub func(interface{}) map[string]sharedaction.CommandInfo 27 commandInfosMutex sync.RWMutex 28 commandInfosArgsForCall []struct { 29 arg1 interface{} 30 } 31 commandInfosReturns struct { 32 result1 map[string]sharedaction.CommandInfo 33 } 34 commandInfosReturnsOnCall map[int]struct { 35 result1 map[string]sharedaction.CommandInfo 36 } 37 invocations map[string][][]interface{} 38 invocationsMutex sync.RWMutex 39 } 40 41 func (fake *FakeHelpActor) CommandInfoByName(arg1 interface{}, arg2 string) (sharedaction.CommandInfo, error) { 42 fake.commandInfoByNameMutex.Lock() 43 ret, specificReturn := fake.commandInfoByNameReturnsOnCall[len(fake.commandInfoByNameArgsForCall)] 44 fake.commandInfoByNameArgsForCall = append(fake.commandInfoByNameArgsForCall, struct { 45 arg1 interface{} 46 arg2 string 47 }{arg1, arg2}) 48 fake.recordInvocation("CommandInfoByName", []interface{}{arg1, arg2}) 49 fake.commandInfoByNameMutex.Unlock() 50 if fake.CommandInfoByNameStub != nil { 51 return fake.CommandInfoByNameStub(arg1, arg2) 52 } 53 if specificReturn { 54 return ret.result1, ret.result2 55 } 56 fakeReturns := fake.commandInfoByNameReturns 57 return fakeReturns.result1, fakeReturns.result2 58 } 59 60 func (fake *FakeHelpActor) CommandInfoByNameCallCount() int { 61 fake.commandInfoByNameMutex.RLock() 62 defer fake.commandInfoByNameMutex.RUnlock() 63 return len(fake.commandInfoByNameArgsForCall) 64 } 65 66 func (fake *FakeHelpActor) CommandInfoByNameCalls(stub func(interface{}, string) (sharedaction.CommandInfo, error)) { 67 fake.commandInfoByNameMutex.Lock() 68 defer fake.commandInfoByNameMutex.Unlock() 69 fake.CommandInfoByNameStub = stub 70 } 71 72 func (fake *FakeHelpActor) CommandInfoByNameArgsForCall(i int) (interface{}, string) { 73 fake.commandInfoByNameMutex.RLock() 74 defer fake.commandInfoByNameMutex.RUnlock() 75 argsForCall := fake.commandInfoByNameArgsForCall[i] 76 return argsForCall.arg1, argsForCall.arg2 77 } 78 79 func (fake *FakeHelpActor) CommandInfoByNameReturns(result1 sharedaction.CommandInfo, result2 error) { 80 fake.commandInfoByNameMutex.Lock() 81 defer fake.commandInfoByNameMutex.Unlock() 82 fake.CommandInfoByNameStub = nil 83 fake.commandInfoByNameReturns = struct { 84 result1 sharedaction.CommandInfo 85 result2 error 86 }{result1, result2} 87 } 88 89 func (fake *FakeHelpActor) CommandInfoByNameReturnsOnCall(i int, result1 sharedaction.CommandInfo, result2 error) { 90 fake.commandInfoByNameMutex.Lock() 91 defer fake.commandInfoByNameMutex.Unlock() 92 fake.CommandInfoByNameStub = nil 93 if fake.commandInfoByNameReturnsOnCall == nil { 94 fake.commandInfoByNameReturnsOnCall = make(map[int]struct { 95 result1 sharedaction.CommandInfo 96 result2 error 97 }) 98 } 99 fake.commandInfoByNameReturnsOnCall[i] = struct { 100 result1 sharedaction.CommandInfo 101 result2 error 102 }{result1, result2} 103 } 104 105 func (fake *FakeHelpActor) CommandInfos(arg1 interface{}) map[string]sharedaction.CommandInfo { 106 fake.commandInfosMutex.Lock() 107 ret, specificReturn := fake.commandInfosReturnsOnCall[len(fake.commandInfosArgsForCall)] 108 fake.commandInfosArgsForCall = append(fake.commandInfosArgsForCall, struct { 109 arg1 interface{} 110 }{arg1}) 111 fake.recordInvocation("CommandInfos", []interface{}{arg1}) 112 fake.commandInfosMutex.Unlock() 113 if fake.CommandInfosStub != nil { 114 return fake.CommandInfosStub(arg1) 115 } 116 if specificReturn { 117 return ret.result1 118 } 119 fakeReturns := fake.commandInfosReturns 120 return fakeReturns.result1 121 } 122 123 func (fake *FakeHelpActor) CommandInfosCallCount() int { 124 fake.commandInfosMutex.RLock() 125 defer fake.commandInfosMutex.RUnlock() 126 return len(fake.commandInfosArgsForCall) 127 } 128 129 func (fake *FakeHelpActor) CommandInfosCalls(stub func(interface{}) map[string]sharedaction.CommandInfo) { 130 fake.commandInfosMutex.Lock() 131 defer fake.commandInfosMutex.Unlock() 132 fake.CommandInfosStub = stub 133 } 134 135 func (fake *FakeHelpActor) CommandInfosArgsForCall(i int) interface{} { 136 fake.commandInfosMutex.RLock() 137 defer fake.commandInfosMutex.RUnlock() 138 argsForCall := fake.commandInfosArgsForCall[i] 139 return argsForCall.arg1 140 } 141 142 func (fake *FakeHelpActor) CommandInfosReturns(result1 map[string]sharedaction.CommandInfo) { 143 fake.commandInfosMutex.Lock() 144 defer fake.commandInfosMutex.Unlock() 145 fake.CommandInfosStub = nil 146 fake.commandInfosReturns = struct { 147 result1 map[string]sharedaction.CommandInfo 148 }{result1} 149 } 150 151 func (fake *FakeHelpActor) CommandInfosReturnsOnCall(i int, result1 map[string]sharedaction.CommandInfo) { 152 fake.commandInfosMutex.Lock() 153 defer fake.commandInfosMutex.Unlock() 154 fake.CommandInfosStub = nil 155 if fake.commandInfosReturnsOnCall == nil { 156 fake.commandInfosReturnsOnCall = make(map[int]struct { 157 result1 map[string]sharedaction.CommandInfo 158 }) 159 } 160 fake.commandInfosReturnsOnCall[i] = struct { 161 result1 map[string]sharedaction.CommandInfo 162 }{result1} 163 } 164 165 func (fake *FakeHelpActor) Invocations() map[string][][]interface{} { 166 fake.invocationsMutex.RLock() 167 defer fake.invocationsMutex.RUnlock() 168 fake.commandInfoByNameMutex.RLock() 169 defer fake.commandInfoByNameMutex.RUnlock() 170 fake.commandInfosMutex.RLock() 171 defer fake.commandInfosMutex.RUnlock() 172 copiedInvocations := map[string][][]interface{}{} 173 for key, value := range fake.invocations { 174 copiedInvocations[key] = value 175 } 176 return copiedInvocations 177 } 178 179 func (fake *FakeHelpActor) recordInvocation(key string, args []interface{}) { 180 fake.invocationsMutex.Lock() 181 defer fake.invocationsMutex.Unlock() 182 if fake.invocations == nil { 183 fake.invocations = map[string][][]interface{}{} 184 } 185 if fake.invocations[key] == nil { 186 fake.invocations[key] = [][]interface{}{} 187 } 188 fake.invocations[key] = append(fake.invocations[key], args) 189 } 190 191 var _ common.HelpActor = new(FakeHelpActor)