github.com/jasonkeene/cli@v6.14.1-0.20160816203908-ca5715166dfb+incompatible/cf/api/securitygroups/spaces/spacesfakes/fake_security_group_space_binder.go (about) 1 // This file was generated by counterfeiter 2 package spacesfakes 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry/cli/cf/api/securitygroups/spaces" 8 ) 9 10 type FakeSecurityGroupSpaceBinder struct { 11 BindSpaceStub func(securityGroupGUID string, spaceGUID string) error 12 bindSpaceMutex sync.RWMutex 13 bindSpaceArgsForCall []struct { 14 securityGroupGUID string 15 spaceGUID string 16 } 17 bindSpaceReturns struct { 18 result1 error 19 } 20 UnbindSpaceStub func(securityGroupGUID string, spaceGUID string) error 21 unbindSpaceMutex sync.RWMutex 22 unbindSpaceArgsForCall []struct { 23 securityGroupGUID string 24 spaceGUID string 25 } 26 unbindSpaceReturns struct { 27 result1 error 28 } 29 invocations map[string][][]interface{} 30 invocationsMutex sync.RWMutex 31 } 32 33 func (fake *FakeSecurityGroupSpaceBinder) BindSpace(securityGroupGUID string, spaceGUID string) error { 34 fake.bindSpaceMutex.Lock() 35 fake.bindSpaceArgsForCall = append(fake.bindSpaceArgsForCall, struct { 36 securityGroupGUID string 37 spaceGUID string 38 }{securityGroupGUID, spaceGUID}) 39 fake.recordInvocation("BindSpace", []interface{}{securityGroupGUID, spaceGUID}) 40 fake.bindSpaceMutex.Unlock() 41 if fake.BindSpaceStub != nil { 42 return fake.BindSpaceStub(securityGroupGUID, spaceGUID) 43 } else { 44 return fake.bindSpaceReturns.result1 45 } 46 } 47 48 func (fake *FakeSecurityGroupSpaceBinder) BindSpaceCallCount() int { 49 fake.bindSpaceMutex.RLock() 50 defer fake.bindSpaceMutex.RUnlock() 51 return len(fake.bindSpaceArgsForCall) 52 } 53 54 func (fake *FakeSecurityGroupSpaceBinder) BindSpaceArgsForCall(i int) (string, string) { 55 fake.bindSpaceMutex.RLock() 56 defer fake.bindSpaceMutex.RUnlock() 57 return fake.bindSpaceArgsForCall[i].securityGroupGUID, fake.bindSpaceArgsForCall[i].spaceGUID 58 } 59 60 func (fake *FakeSecurityGroupSpaceBinder) BindSpaceReturns(result1 error) { 61 fake.BindSpaceStub = nil 62 fake.bindSpaceReturns = struct { 63 result1 error 64 }{result1} 65 } 66 67 func (fake *FakeSecurityGroupSpaceBinder) UnbindSpace(securityGroupGUID string, spaceGUID string) error { 68 fake.unbindSpaceMutex.Lock() 69 fake.unbindSpaceArgsForCall = append(fake.unbindSpaceArgsForCall, struct { 70 securityGroupGUID string 71 spaceGUID string 72 }{securityGroupGUID, spaceGUID}) 73 fake.recordInvocation("UnbindSpace", []interface{}{securityGroupGUID, spaceGUID}) 74 fake.unbindSpaceMutex.Unlock() 75 if fake.UnbindSpaceStub != nil { 76 return fake.UnbindSpaceStub(securityGroupGUID, spaceGUID) 77 } else { 78 return fake.unbindSpaceReturns.result1 79 } 80 } 81 82 func (fake *FakeSecurityGroupSpaceBinder) UnbindSpaceCallCount() int { 83 fake.unbindSpaceMutex.RLock() 84 defer fake.unbindSpaceMutex.RUnlock() 85 return len(fake.unbindSpaceArgsForCall) 86 } 87 88 func (fake *FakeSecurityGroupSpaceBinder) UnbindSpaceArgsForCall(i int) (string, string) { 89 fake.unbindSpaceMutex.RLock() 90 defer fake.unbindSpaceMutex.RUnlock() 91 return fake.unbindSpaceArgsForCall[i].securityGroupGUID, fake.unbindSpaceArgsForCall[i].spaceGUID 92 } 93 94 func (fake *FakeSecurityGroupSpaceBinder) UnbindSpaceReturns(result1 error) { 95 fake.UnbindSpaceStub = nil 96 fake.unbindSpaceReturns = struct { 97 result1 error 98 }{result1} 99 } 100 101 func (fake *FakeSecurityGroupSpaceBinder) Invocations() map[string][][]interface{} { 102 fake.invocationsMutex.RLock() 103 defer fake.invocationsMutex.RUnlock() 104 fake.bindSpaceMutex.RLock() 105 defer fake.bindSpaceMutex.RUnlock() 106 fake.unbindSpaceMutex.RLock() 107 defer fake.unbindSpaceMutex.RUnlock() 108 return fake.invocations 109 } 110 111 func (fake *FakeSecurityGroupSpaceBinder) recordInvocation(key string, args []interface{}) { 112 fake.invocationsMutex.Lock() 113 defer fake.invocationsMutex.Unlock() 114 if fake.invocations == nil { 115 fake.invocations = map[string][][]interface{}{} 116 } 117 if fake.invocations[key] == nil { 118 fake.invocations[key] = [][]interface{}{} 119 } 120 fake.invocations[key] = append(fake.invocations[key], args) 121 } 122 123 var _ spaces.SecurityGroupSpaceBinder = new(FakeSecurityGroupSpaceBinder)