github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/apifakes/fake_service_plan_visibility_repository.go (about) 1 // This file was generated by counterfeiter 2 package apifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeServicePlanVisibilityRepository struct { 12 CreateStub func(string, string) error 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 string 16 arg2 string 17 } 18 createReturns struct { 19 result1 error 20 } 21 ListStub func() ([]models.ServicePlanVisibilityFields, error) 22 listMutex sync.RWMutex 23 listArgsForCall []struct{} 24 listReturns struct { 25 result1 []models.ServicePlanVisibilityFields 26 result2 error 27 } 28 DeleteStub func(string) error 29 deleteMutex sync.RWMutex 30 deleteArgsForCall []struct { 31 arg1 string 32 } 33 deleteReturns struct { 34 result1 error 35 } 36 SearchStub func(map[string]string) ([]models.ServicePlanVisibilityFields, error) 37 searchMutex sync.RWMutex 38 searchArgsForCall []struct { 39 arg1 map[string]string 40 } 41 searchReturns struct { 42 result1 []models.ServicePlanVisibilityFields 43 result2 error 44 } 45 invocations map[string][][]interface{} 46 invocationsMutex sync.RWMutex 47 } 48 49 func (fake *FakeServicePlanVisibilityRepository) Create(arg1 string, arg2 string) error { 50 fake.createMutex.Lock() 51 fake.createArgsForCall = append(fake.createArgsForCall, struct { 52 arg1 string 53 arg2 string 54 }{arg1, arg2}) 55 fake.recordInvocation("Create", []interface{}{arg1, arg2}) 56 fake.createMutex.Unlock() 57 if fake.CreateStub != nil { 58 return fake.CreateStub(arg1, arg2) 59 } else { 60 return fake.createReturns.result1 61 } 62 } 63 64 func (fake *FakeServicePlanVisibilityRepository) CreateCallCount() int { 65 fake.createMutex.RLock() 66 defer fake.createMutex.RUnlock() 67 return len(fake.createArgsForCall) 68 } 69 70 func (fake *FakeServicePlanVisibilityRepository) CreateArgsForCall(i int) (string, string) { 71 fake.createMutex.RLock() 72 defer fake.createMutex.RUnlock() 73 return fake.createArgsForCall[i].arg1, fake.createArgsForCall[i].arg2 74 } 75 76 func (fake *FakeServicePlanVisibilityRepository) CreateReturns(result1 error) { 77 fake.CreateStub = nil 78 fake.createReturns = struct { 79 result1 error 80 }{result1} 81 } 82 83 func (fake *FakeServicePlanVisibilityRepository) List() ([]models.ServicePlanVisibilityFields, error) { 84 fake.listMutex.Lock() 85 fake.listArgsForCall = append(fake.listArgsForCall, struct{}{}) 86 fake.recordInvocation("List", []interface{}{}) 87 fake.listMutex.Unlock() 88 if fake.ListStub != nil { 89 return fake.ListStub() 90 } else { 91 return fake.listReturns.result1, fake.listReturns.result2 92 } 93 } 94 95 func (fake *FakeServicePlanVisibilityRepository) ListCallCount() int { 96 fake.listMutex.RLock() 97 defer fake.listMutex.RUnlock() 98 return len(fake.listArgsForCall) 99 } 100 101 func (fake *FakeServicePlanVisibilityRepository) ListReturns(result1 []models.ServicePlanVisibilityFields, result2 error) { 102 fake.ListStub = nil 103 fake.listReturns = struct { 104 result1 []models.ServicePlanVisibilityFields 105 result2 error 106 }{result1, result2} 107 } 108 109 func (fake *FakeServicePlanVisibilityRepository) Delete(arg1 string) error { 110 fake.deleteMutex.Lock() 111 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 112 arg1 string 113 }{arg1}) 114 fake.recordInvocation("Delete", []interface{}{arg1}) 115 fake.deleteMutex.Unlock() 116 if fake.DeleteStub != nil { 117 return fake.DeleteStub(arg1) 118 } else { 119 return fake.deleteReturns.result1 120 } 121 } 122 123 func (fake *FakeServicePlanVisibilityRepository) DeleteCallCount() int { 124 fake.deleteMutex.RLock() 125 defer fake.deleteMutex.RUnlock() 126 return len(fake.deleteArgsForCall) 127 } 128 129 func (fake *FakeServicePlanVisibilityRepository) DeleteArgsForCall(i int) string { 130 fake.deleteMutex.RLock() 131 defer fake.deleteMutex.RUnlock() 132 return fake.deleteArgsForCall[i].arg1 133 } 134 135 func (fake *FakeServicePlanVisibilityRepository) DeleteReturns(result1 error) { 136 fake.DeleteStub = nil 137 fake.deleteReturns = struct { 138 result1 error 139 }{result1} 140 } 141 142 func (fake *FakeServicePlanVisibilityRepository) Search(arg1 map[string]string) ([]models.ServicePlanVisibilityFields, error) { 143 fake.searchMutex.Lock() 144 fake.searchArgsForCall = append(fake.searchArgsForCall, struct { 145 arg1 map[string]string 146 }{arg1}) 147 fake.recordInvocation("Search", []interface{}{arg1}) 148 fake.searchMutex.Unlock() 149 if fake.SearchStub != nil { 150 return fake.SearchStub(arg1) 151 } else { 152 return fake.searchReturns.result1, fake.searchReturns.result2 153 } 154 } 155 156 func (fake *FakeServicePlanVisibilityRepository) SearchCallCount() int { 157 fake.searchMutex.RLock() 158 defer fake.searchMutex.RUnlock() 159 return len(fake.searchArgsForCall) 160 } 161 162 func (fake *FakeServicePlanVisibilityRepository) SearchArgsForCall(i int) map[string]string { 163 fake.searchMutex.RLock() 164 defer fake.searchMutex.RUnlock() 165 return fake.searchArgsForCall[i].arg1 166 } 167 168 func (fake *FakeServicePlanVisibilityRepository) SearchReturns(result1 []models.ServicePlanVisibilityFields, result2 error) { 169 fake.SearchStub = nil 170 fake.searchReturns = struct { 171 result1 []models.ServicePlanVisibilityFields 172 result2 error 173 }{result1, result2} 174 } 175 176 func (fake *FakeServicePlanVisibilityRepository) Invocations() map[string][][]interface{} { 177 fake.invocationsMutex.RLock() 178 defer fake.invocationsMutex.RUnlock() 179 fake.createMutex.RLock() 180 defer fake.createMutex.RUnlock() 181 fake.listMutex.RLock() 182 defer fake.listMutex.RUnlock() 183 fake.deleteMutex.RLock() 184 defer fake.deleteMutex.RUnlock() 185 fake.searchMutex.RLock() 186 defer fake.searchMutex.RUnlock() 187 return fake.invocations 188 } 189 190 func (fake *FakeServicePlanVisibilityRepository) recordInvocation(key string, args []interface{}) { 191 fake.invocationsMutex.Lock() 192 defer fake.invocationsMutex.Unlock() 193 if fake.invocations == nil { 194 fake.invocations = map[string][][]interface{}{} 195 } 196 if fake.invocations[key] == nil { 197 fake.invocations[key] = [][]interface{}{} 198 } 199 fake.invocations[key] = append(fake.invocations[key], args) 200 } 201 202 var _ api.ServicePlanVisibilityRepository = new(FakeServicePlanVisibilityRepository)