github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/commands/v2/v2fakes/fake_help_actor.go (about) 1 // This file was generated by counterfeiter 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actors/v2actions" 8 "code.cloudfoundry.org/cli/commands/v2" 9 ) 10 11 type FakeHelpActor struct { 12 CommandInfoByNameStub func(interface{}, string) (v2actions.CommandInfo, error) 13 commandInfoByNameMutex sync.RWMutex 14 commandInfoByNameArgsForCall []struct { 15 arg1 interface{} 16 arg2 string 17 } 18 commandInfoByNameReturns struct { 19 result1 v2actions.CommandInfo 20 result2 error 21 } 22 CommandInfosStub func(interface{}) map[string]v2actions.CommandInfo 23 commandInfosMutex sync.RWMutex 24 commandInfosArgsForCall []struct { 25 arg1 interface{} 26 } 27 commandInfosReturns struct { 28 result1 map[string]v2actions.CommandInfo 29 } 30 invocations map[string][][]interface{} 31 invocationsMutex sync.RWMutex 32 } 33 34 func (fake *FakeHelpActor) CommandInfoByName(arg1 interface{}, arg2 string) (v2actions.CommandInfo, error) { 35 fake.commandInfoByNameMutex.Lock() 36 fake.commandInfoByNameArgsForCall = append(fake.commandInfoByNameArgsForCall, struct { 37 arg1 interface{} 38 arg2 string 39 }{arg1, arg2}) 40 fake.recordInvocation("CommandInfoByName", []interface{}{arg1, arg2}) 41 fake.commandInfoByNameMutex.Unlock() 42 if fake.CommandInfoByNameStub != nil { 43 return fake.CommandInfoByNameStub(arg1, arg2) 44 } else { 45 return fake.commandInfoByNameReturns.result1, fake.commandInfoByNameReturns.result2 46 } 47 } 48 49 func (fake *FakeHelpActor) CommandInfoByNameCallCount() int { 50 fake.commandInfoByNameMutex.RLock() 51 defer fake.commandInfoByNameMutex.RUnlock() 52 return len(fake.commandInfoByNameArgsForCall) 53 } 54 55 func (fake *FakeHelpActor) CommandInfoByNameArgsForCall(i int) (interface{}, string) { 56 fake.commandInfoByNameMutex.RLock() 57 defer fake.commandInfoByNameMutex.RUnlock() 58 return fake.commandInfoByNameArgsForCall[i].arg1, fake.commandInfoByNameArgsForCall[i].arg2 59 } 60 61 func (fake *FakeHelpActor) CommandInfoByNameReturns(result1 v2actions.CommandInfo, result2 error) { 62 fake.CommandInfoByNameStub = nil 63 fake.commandInfoByNameReturns = struct { 64 result1 v2actions.CommandInfo 65 result2 error 66 }{result1, result2} 67 } 68 69 func (fake *FakeHelpActor) CommandInfos(arg1 interface{}) map[string]v2actions.CommandInfo { 70 fake.commandInfosMutex.Lock() 71 fake.commandInfosArgsForCall = append(fake.commandInfosArgsForCall, struct { 72 arg1 interface{} 73 }{arg1}) 74 fake.recordInvocation("CommandInfos", []interface{}{arg1}) 75 fake.commandInfosMutex.Unlock() 76 if fake.CommandInfosStub != nil { 77 return fake.CommandInfosStub(arg1) 78 } else { 79 return fake.commandInfosReturns.result1 80 } 81 } 82 83 func (fake *FakeHelpActor) CommandInfosCallCount() int { 84 fake.commandInfosMutex.RLock() 85 defer fake.commandInfosMutex.RUnlock() 86 return len(fake.commandInfosArgsForCall) 87 } 88 89 func (fake *FakeHelpActor) CommandInfosArgsForCall(i int) interface{} { 90 fake.commandInfosMutex.RLock() 91 defer fake.commandInfosMutex.RUnlock() 92 return fake.commandInfosArgsForCall[i].arg1 93 } 94 95 func (fake *FakeHelpActor) CommandInfosReturns(result1 map[string]v2actions.CommandInfo) { 96 fake.CommandInfosStub = nil 97 fake.commandInfosReturns = struct { 98 result1 map[string]v2actions.CommandInfo 99 }{result1} 100 } 101 102 func (fake *FakeHelpActor) Invocations() map[string][][]interface{} { 103 fake.invocationsMutex.RLock() 104 defer fake.invocationsMutex.RUnlock() 105 fake.commandInfoByNameMutex.RLock() 106 defer fake.commandInfoByNameMutex.RUnlock() 107 fake.commandInfosMutex.RLock() 108 defer fake.commandInfosMutex.RUnlock() 109 return fake.invocations 110 } 111 112 func (fake *FakeHelpActor) recordInvocation(key string, args []interface{}) { 113 fake.invocationsMutex.Lock() 114 defer fake.invocationsMutex.Unlock() 115 if fake.invocations == nil { 116 fake.invocations = map[string][][]interface{}{} 117 } 118 if fake.invocations[key] == nil { 119 fake.invocations[key] = [][]interface{}{} 120 } 121 fake.invocations[key] = append(fake.invocations[key], args) 122 } 123 124 var _ v2.HelpActor = new(FakeHelpActor)