github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/appfiles/appfilesfakes/fake_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package appfilesfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api/appfiles" 8 ) 9 10 type FakeRepository struct { 11 ListFilesStub func(string, int, string) (string, error) 12 listFilesMutex sync.RWMutex 13 listFilesArgsForCall []struct { 14 arg1 string 15 arg2 int 16 arg3 string 17 } 18 listFilesReturns struct { 19 result1 string 20 result2 error 21 } 22 listFilesReturnsOnCall map[int]struct { 23 result1 string 24 result2 error 25 } 26 invocations map[string][][]interface{} 27 invocationsMutex sync.RWMutex 28 } 29 30 func (fake *FakeRepository) ListFiles(arg1 string, arg2 int, arg3 string) (string, error) { 31 fake.listFilesMutex.Lock() 32 ret, specificReturn := fake.listFilesReturnsOnCall[len(fake.listFilesArgsForCall)] 33 fake.listFilesArgsForCall = append(fake.listFilesArgsForCall, struct { 34 arg1 string 35 arg2 int 36 arg3 string 37 }{arg1, arg2, arg3}) 38 fake.recordInvocation("ListFiles", []interface{}{arg1, arg2, arg3}) 39 fake.listFilesMutex.Unlock() 40 if fake.ListFilesStub != nil { 41 return fake.ListFilesStub(arg1, arg2, arg3) 42 } 43 if specificReturn { 44 return ret.result1, ret.result2 45 } 46 fakeReturns := fake.listFilesReturns 47 return fakeReturns.result1, fakeReturns.result2 48 } 49 50 func (fake *FakeRepository) ListFilesCallCount() int { 51 fake.listFilesMutex.RLock() 52 defer fake.listFilesMutex.RUnlock() 53 return len(fake.listFilesArgsForCall) 54 } 55 56 func (fake *FakeRepository) ListFilesCalls(stub func(string, int, string) (string, error)) { 57 fake.listFilesMutex.Lock() 58 defer fake.listFilesMutex.Unlock() 59 fake.ListFilesStub = stub 60 } 61 62 func (fake *FakeRepository) ListFilesArgsForCall(i int) (string, int, string) { 63 fake.listFilesMutex.RLock() 64 defer fake.listFilesMutex.RUnlock() 65 argsForCall := fake.listFilesArgsForCall[i] 66 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 67 } 68 69 func (fake *FakeRepository) ListFilesReturns(result1 string, result2 error) { 70 fake.listFilesMutex.Lock() 71 defer fake.listFilesMutex.Unlock() 72 fake.ListFilesStub = nil 73 fake.listFilesReturns = struct { 74 result1 string 75 result2 error 76 }{result1, result2} 77 } 78 79 func (fake *FakeRepository) ListFilesReturnsOnCall(i int, result1 string, result2 error) { 80 fake.listFilesMutex.Lock() 81 defer fake.listFilesMutex.Unlock() 82 fake.ListFilesStub = nil 83 if fake.listFilesReturnsOnCall == nil { 84 fake.listFilesReturnsOnCall = make(map[int]struct { 85 result1 string 86 result2 error 87 }) 88 } 89 fake.listFilesReturnsOnCall[i] = struct { 90 result1 string 91 result2 error 92 }{result1, result2} 93 } 94 95 func (fake *FakeRepository) Invocations() map[string][][]interface{} { 96 fake.invocationsMutex.RLock() 97 defer fake.invocationsMutex.RUnlock() 98 fake.listFilesMutex.RLock() 99 defer fake.listFilesMutex.RUnlock() 100 copiedInvocations := map[string][][]interface{}{} 101 for key, value := range fake.invocations { 102 copiedInvocations[key] = value 103 } 104 return copiedInvocations 105 } 106 107 func (fake *FakeRepository) recordInvocation(key string, args []interface{}) { 108 fake.invocationsMutex.Lock() 109 defer fake.invocationsMutex.Unlock() 110 if fake.invocations == nil { 111 fake.invocations = map[string][][]interface{}{} 112 } 113 if fake.invocations[key] == nil { 114 fake.invocations[key] = [][]interface{}{} 115 } 116 fake.invocations[key] = append(fake.invocations[key], args) 117 } 118 119 var _ appfiles.Repository = new(FakeRepository)