github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/command/v2/v2fakes/fake_unbind_service_actor.go (about) 1 // This file was generated by counterfeiter 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "code.cloudfoundry.org/cli/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 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeUnbindServiceActor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (v2action.Warnings, error) { 28 fake.unbindServiceBySpaceMutex.Lock() 29 fake.unbindServiceBySpaceArgsForCall = append(fake.unbindServiceBySpaceArgsForCall, struct { 30 appName string 31 serviceInstanceName string 32 spaceGUID string 33 }{appName, serviceInstanceName, spaceGUID}) 34 fake.recordInvocation("UnbindServiceBySpace", []interface{}{appName, serviceInstanceName, spaceGUID}) 35 fake.unbindServiceBySpaceMutex.Unlock() 36 if fake.UnbindServiceBySpaceStub != nil { 37 return fake.UnbindServiceBySpaceStub(appName, serviceInstanceName, spaceGUID) 38 } else { 39 return fake.unbindServiceBySpaceReturns.result1, fake.unbindServiceBySpaceReturns.result2 40 } 41 } 42 43 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceCallCount() int { 44 fake.unbindServiceBySpaceMutex.RLock() 45 defer fake.unbindServiceBySpaceMutex.RUnlock() 46 return len(fake.unbindServiceBySpaceArgsForCall) 47 } 48 49 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceArgsForCall(i int) (string, string, string) { 50 fake.unbindServiceBySpaceMutex.RLock() 51 defer fake.unbindServiceBySpaceMutex.RUnlock() 52 return fake.unbindServiceBySpaceArgsForCall[i].appName, fake.unbindServiceBySpaceArgsForCall[i].serviceInstanceName, fake.unbindServiceBySpaceArgsForCall[i].spaceGUID 53 } 54 55 func (fake *FakeUnbindServiceActor) UnbindServiceBySpaceReturns(result1 v2action.Warnings, result2 error) { 56 fake.UnbindServiceBySpaceStub = nil 57 fake.unbindServiceBySpaceReturns = struct { 58 result1 v2action.Warnings 59 result2 error 60 }{result1, result2} 61 } 62 63 func (fake *FakeUnbindServiceActor) Invocations() map[string][][]interface{} { 64 fake.invocationsMutex.RLock() 65 defer fake.invocationsMutex.RUnlock() 66 fake.unbindServiceBySpaceMutex.RLock() 67 defer fake.unbindServiceBySpaceMutex.RUnlock() 68 return fake.invocations 69 } 70 71 func (fake *FakeUnbindServiceActor) recordInvocation(key string, args []interface{}) { 72 fake.invocationsMutex.Lock() 73 defer fake.invocationsMutex.Unlock() 74 if fake.invocations == nil { 75 fake.invocations = map[string][][]interface{}{} 76 } 77 if fake.invocations[key] == nil { 78 fake.invocations[key] = [][]interface{}{} 79 } 80 fake.invocations[key] = append(fake.invocations[key], args) 81 } 82 83 var _ v2.UnbindServiceActor = new(FakeUnbindServiceActor)