github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/command/v6/v6fakes/fake_v2actor_maker.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v6fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/command" 8 v6 "code.cloudfoundry.org/cli/command/v6" 9 ) 10 11 type FakeV2ActorMaker struct { 12 NewV2ActorStub func(command.Config, command.UI, bool) (v6.V2LoginActor, error) 13 newV2ActorMutex sync.RWMutex 14 newV2ActorArgsForCall []struct { 15 arg1 command.Config 16 arg2 command.UI 17 arg3 bool 18 } 19 newV2ActorReturns struct { 20 result1 v6.V2LoginActor 21 result2 error 22 } 23 newV2ActorReturnsOnCall map[int]struct { 24 result1 v6.V2LoginActor 25 result2 error 26 } 27 invocations map[string][][]interface{} 28 invocationsMutex sync.RWMutex 29 } 30 31 func (fake *FakeV2ActorMaker) NewV2Actor(arg1 command.Config, arg2 command.UI, arg3 bool) (v6.V2LoginActor, error) { 32 fake.newV2ActorMutex.Lock() 33 ret, specificReturn := fake.newV2ActorReturnsOnCall[len(fake.newV2ActorArgsForCall)] 34 fake.newV2ActorArgsForCall = append(fake.newV2ActorArgsForCall, struct { 35 arg1 command.Config 36 arg2 command.UI 37 arg3 bool 38 }{arg1, arg2, arg3}) 39 fake.recordInvocation("NewV2Actor", []interface{}{arg1, arg2, arg3}) 40 fake.newV2ActorMutex.Unlock() 41 if fake.NewV2ActorStub != nil { 42 return fake.NewV2ActorStub(arg1, arg2, arg3) 43 } 44 if specificReturn { 45 return ret.result1, ret.result2 46 } 47 fakeReturns := fake.newV2ActorReturns 48 return fakeReturns.result1, fakeReturns.result2 49 } 50 51 func (fake *FakeV2ActorMaker) NewV2ActorCallCount() int { 52 fake.newV2ActorMutex.RLock() 53 defer fake.newV2ActorMutex.RUnlock() 54 return len(fake.newV2ActorArgsForCall) 55 } 56 57 func (fake *FakeV2ActorMaker) NewV2ActorCalls(stub func(command.Config, command.UI, bool) (v6.V2LoginActor, error)) { 58 fake.newV2ActorMutex.Lock() 59 defer fake.newV2ActorMutex.Unlock() 60 fake.NewV2ActorStub = stub 61 } 62 63 func (fake *FakeV2ActorMaker) NewV2ActorArgsForCall(i int) (command.Config, command.UI, bool) { 64 fake.newV2ActorMutex.RLock() 65 defer fake.newV2ActorMutex.RUnlock() 66 argsForCall := fake.newV2ActorArgsForCall[i] 67 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 68 } 69 70 func (fake *FakeV2ActorMaker) NewV2ActorReturns(result1 v6.V2LoginActor, result2 error) { 71 fake.newV2ActorMutex.Lock() 72 defer fake.newV2ActorMutex.Unlock() 73 fake.NewV2ActorStub = nil 74 fake.newV2ActorReturns = struct { 75 result1 v6.V2LoginActor 76 result2 error 77 }{result1, result2} 78 } 79 80 func (fake *FakeV2ActorMaker) NewV2ActorReturnsOnCall(i int, result1 v6.V2LoginActor, result2 error) { 81 fake.newV2ActorMutex.Lock() 82 defer fake.newV2ActorMutex.Unlock() 83 fake.NewV2ActorStub = nil 84 if fake.newV2ActorReturnsOnCall == nil { 85 fake.newV2ActorReturnsOnCall = make(map[int]struct { 86 result1 v6.V2LoginActor 87 result2 error 88 }) 89 } 90 fake.newV2ActorReturnsOnCall[i] = struct { 91 result1 v6.V2LoginActor 92 result2 error 93 }{result1, result2} 94 } 95 96 func (fake *FakeV2ActorMaker) Invocations() map[string][][]interface{} { 97 fake.invocationsMutex.RLock() 98 defer fake.invocationsMutex.RUnlock() 99 fake.newV2ActorMutex.RLock() 100 defer fake.newV2ActorMutex.RUnlock() 101 copiedInvocations := map[string][][]interface{}{} 102 for key, value := range fake.invocations { 103 copiedInvocations[key] = value 104 } 105 return copiedInvocations 106 } 107 108 func (fake *FakeV2ActorMaker) recordInvocation(key string, args []interface{}) { 109 fake.invocationsMutex.Lock() 110 defer fake.invocationsMutex.Unlock() 111 if fake.invocations == nil { 112 fake.invocations = map[string][][]interface{}{} 113 } 114 if fake.invocations[key] == nil { 115 fake.invocations[key] = [][]interface{}{} 116 } 117 fake.invocations[key] = append(fake.invocations[key], args) 118 } 119 120 var _ v6.V2ActorMaker = new(FakeV2ActorMaker)