github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/appfiles/appfilesfakes/fake_app_files_repository.go (about) 1 // This file was generated by counterfeiter 2 package appfilesfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api/appfiles" 8 ) 9 10 type FakeAppFilesRepository struct { 11 ListFilesStub func(appGUID string, instance int, path string) (files string, apiErr error) 12 listFilesMutex sync.RWMutex 13 listFilesArgsForCall []struct { 14 appGUID string 15 instance int 16 path string 17 } 18 listFilesReturns struct { 19 result1 string 20 result2 error 21 } 22 } 23 24 func (fake *FakeAppFilesRepository) ListFiles(appGUID string, instance int, path string) (files string, apiErr error) { 25 fake.listFilesMutex.Lock() 26 fake.listFilesArgsForCall = append(fake.listFilesArgsForCall, struct { 27 appGUID string 28 instance int 29 path string 30 }{appGUID, instance, path}) 31 fake.listFilesMutex.Unlock() 32 if fake.ListFilesStub != nil { 33 return fake.ListFilesStub(appGUID, instance, path) 34 } else { 35 return fake.listFilesReturns.result1, fake.listFilesReturns.result2 36 } 37 } 38 39 func (fake *FakeAppFilesRepository) ListFilesCallCount() int { 40 fake.listFilesMutex.RLock() 41 defer fake.listFilesMutex.RUnlock() 42 return len(fake.listFilesArgsForCall) 43 } 44 45 func (fake *FakeAppFilesRepository) ListFilesArgsForCall(i int) (string, int, string) { 46 fake.listFilesMutex.RLock() 47 defer fake.listFilesMutex.RUnlock() 48 return fake.listFilesArgsForCall[i].appGUID, fake.listFilesArgsForCall[i].instance, fake.listFilesArgsForCall[i].path 49 } 50 51 func (fake *FakeAppFilesRepository) ListFilesReturns(result1 string, result2 error) { 52 fake.ListFilesStub = nil 53 fake.listFilesReturns = struct { 54 result1 string 55 result2 error 56 }{result1, result2} 57 } 58 59 var _ appfiles.Repository = new(FakeAppFilesRepository)