github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/v2fakes/fake_unbind_service_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "github.com/liamawhite/cli-with-i18n/actor/v2action" 8 "github.com/liamawhite/cli-with-i18n/command/v2" 9 ) 10 11 type FakeUnbindServiceActor struct { 12 UnbindServiceBySpaceStub func(appName string, serviceInstanceName string, spaceGUID string) (v2action.Warnings, error) 13 unbindServiceBySpaceMutex sync.RWMutex 14 unbindServiceBySpaceArgsForCall []struct { 15 appName string 16 serviceInstanceName string 17 spaceGUID string 18 } 19 unbindServiceBySpaceReturns struct { 20 result1 v2action.Warnings 21 result2 error 22 } 23 unbindServiceBySpaceReturnsOnCall map[int]struct { 24 result1 v2action.Warnings 25 result2 error 26 } 27 invocations map[string][][]interface{} 28 invocationsMutex sync.RWMutex 29 } 30 31 func (fake *FakeUnbindServiceActor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (v2action.Warnings, error) { 32 fake.unbindServiceBySpaceMutex.Lock() 33 ret, specificReturn := fake.unbindServiceBySpaceReturnsOnCall[len(fake.unbindServiceBySpaceArgsForCall)] 34 fake.unbindServiceBySpaceArgsForCall = append(fake.unbindServiceBySpaceArgsForCall, struct { 35 appName string 36 serviceInstanceName string 37 spaceGUID string 38 }{appName, serviceInstanceName, spaceGUID}) 39 fake.recordInvocation("UnbindServiceBySpace", []interface{}{appName, serviceInstanceName, spaceGUID}) 40 fake.unbindServiceBySpaceMutex.Unlock() 41 if fake.UnbindServiceBySpaceStub != nil { 42 return fake.UnbindServiceBySpaceStub(appName, serviceInstanceName, spaceGUID) 43 } 44 if specificReturn { 45 return ret.result1, ret.result2 46 } 47 return fake.unbindServiceBySpaceReturns.result1, fake.unbindServiceBySpaceReturns.result2 48 } 49 50 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceCallCount() int { 51 fake.unbindServiceBySpaceMutex.RLock() 52 defer fake.unbindServiceBySpaceMutex.RUnlock() 53 return len(fake.unbindServiceBySpaceArgsForCall) 54 } 55 56 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceArgsForCall(i int) (string, string, string) { 57 fake.unbindServiceBySpaceMutex.RLock() 58 defer fake.unbindServiceBySpaceMutex.RUnlock() 59 return fake.unbindServiceBySpaceArgsForCall[i].appName, fake.unbindServiceBySpaceArgsForCall[i].serviceInstanceName, fake.unbindServiceBySpaceArgsForCall[i].spaceGUID 60 } 61 62 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceReturns(result1 v2action.Warnings, result2 error) { 63 fake.UnbindServiceBySpaceStub = nil 64 fake.unbindServiceBySpaceReturns = struct { 65 result1 v2action.Warnings 66 result2 error 67 }{result1, result2} 68 } 69 70 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceReturnsOnCall(i int, result1 v2action.Warnings, result2 error) { 71 fake.UnbindServiceBySpaceStub = nil 72 if fake.unbindServiceBySpaceReturnsOnCall == nil { 73 fake.unbindServiceBySpaceReturnsOnCall = make(map[int]struct { 74 result1 v2action.Warnings 75 result2 error 76 }) 77 } 78 fake.unbindServiceBySpaceReturnsOnCall[i] = struct { 79 result1 v2action.Warnings 80 result2 error 81 }{result1, result2} 82 } 83 84 func (fake *FakeUnbindServiceActor) Invocations() map[string][][]interface{} { 85 fake.invocationsMutex.RLock() 86 defer fake.invocationsMutex.RUnlock() 87 fake.unbindServiceBySpaceMutex.RLock() 88 defer fake.unbindServiceBySpaceMutex.RUnlock() 89 copiedInvocations := map[string][][]interface{}{} 90 for key, value := range fake.invocations { 91 copiedInvocations[key] = value 92 } 93 return copiedInvocations 94 } 95 96 func (fake *FakeUnbindServiceActor) recordInvocation(key string, args []interface{}) { 97 fake.invocationsMutex.Lock() 98 defer fake.invocationsMutex.Unlock() 99 if fake.invocations == nil { 100 fake.invocations = map[string][][]interface{}{} 101 } 102 if fake.invocations[key] == nil { 103 fake.invocations[key] = [][]interface{}{} 104 } 105 fake.invocations[key] = append(fake.invocations[key], args) 106 } 107 108 var _ v2.UnbindServiceActor = new(FakeUnbindServiceActor)