github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/util/utilfakes/fake_sha1checksum.go (about) 1 // This file was generated by counterfeiter 2 package utilfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/util" 8 ) 9 10 type FakeSha1Checksum struct { 11 ComputeFileSha1Stub func() ([]byte, error) 12 computeFileSha1Mutex sync.RWMutex 13 computeFileSha1ArgsForCall []struct{} 14 computeFileSha1Returns struct { 15 result1 []byte 16 result2 error 17 } 18 CheckSha1Stub func(string) bool 19 checkSha1Mutex sync.RWMutex 20 checkSha1ArgsForCall []struct { 21 arg1 string 22 } 23 checkSha1Returns struct { 24 result1 bool 25 } 26 SetFilePathStub func(string) 27 setFilePathMutex sync.RWMutex 28 setFilePathArgsForCall []struct { 29 arg1 string 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33 } 34 35 func (fake *FakeSha1Checksum) ComputeFileSha1() ([]byte, error) { 36 fake.computeFileSha1Mutex.Lock() 37 fake.computeFileSha1ArgsForCall = append(fake.computeFileSha1ArgsForCall, struct{}{}) 38 fake.recordInvocation("ComputeFileSha1", []interface{}{}) 39 fake.computeFileSha1Mutex.Unlock() 40 if fake.ComputeFileSha1Stub != nil { 41 return fake.ComputeFileSha1Stub() 42 } else { 43 return fake.computeFileSha1Returns.result1, fake.computeFileSha1Returns.result2 44 } 45 } 46 47 func (fake *FakeSha1Checksum) ComputeFileSha1CallCount() int { 48 fake.computeFileSha1Mutex.RLock() 49 defer fake.computeFileSha1Mutex.RUnlock() 50 return len(fake.computeFileSha1ArgsForCall) 51 } 52 53 func (fake *FakeSha1Checksum) ComputeFileSha1Returns(result1 []byte, result2 error) { 54 fake.ComputeFileSha1Stub = nil 55 fake.computeFileSha1Returns = struct { 56 result1 []byte 57 result2 error 58 }{result1, result2} 59 } 60 61 func (fake *FakeSha1Checksum) CheckSha1(arg1 string) bool { 62 fake.checkSha1Mutex.Lock() 63 fake.checkSha1ArgsForCall = append(fake.checkSha1ArgsForCall, struct { 64 arg1 string 65 }{arg1}) 66 fake.recordInvocation("CheckSha1", []interface{}{arg1}) 67 fake.checkSha1Mutex.Unlock() 68 if fake.CheckSha1Stub != nil { 69 return fake.CheckSha1Stub(arg1) 70 } else { 71 return fake.checkSha1Returns.result1 72 } 73 } 74 75 func (fake *FakeSha1Checksum) CheckSha1CallCount() int { 76 fake.checkSha1Mutex.RLock() 77 defer fake.checkSha1Mutex.RUnlock() 78 return len(fake.checkSha1ArgsForCall) 79 } 80 81 func (fake *FakeSha1Checksum) CheckSha1ArgsForCall(i int) string { 82 fake.checkSha1Mutex.RLock() 83 defer fake.checkSha1Mutex.RUnlock() 84 return fake.checkSha1ArgsForCall[i].arg1 85 } 86 87 func (fake *FakeSha1Checksum) CheckSha1Returns(result1 bool) { 88 fake.CheckSha1Stub = nil 89 fake.checkSha1Returns = struct { 90 result1 bool 91 }{result1} 92 } 93 94 func (fake *FakeSha1Checksum) SetFilePath(arg1 string) { 95 fake.setFilePathMutex.Lock() 96 fake.setFilePathArgsForCall = append(fake.setFilePathArgsForCall, struct { 97 arg1 string 98 }{arg1}) 99 fake.recordInvocation("SetFilePath", []interface{}{arg1}) 100 fake.setFilePathMutex.Unlock() 101 if fake.SetFilePathStub != nil { 102 fake.SetFilePathStub(arg1) 103 } 104 } 105 106 func (fake *FakeSha1Checksum) SetFilePathCallCount() int { 107 fake.setFilePathMutex.RLock() 108 defer fake.setFilePathMutex.RUnlock() 109 return len(fake.setFilePathArgsForCall) 110 } 111 112 func (fake *FakeSha1Checksum) SetFilePathArgsForCall(i int) string { 113 fake.setFilePathMutex.RLock() 114 defer fake.setFilePathMutex.RUnlock() 115 return fake.setFilePathArgsForCall[i].arg1 116 } 117 118 func (fake *FakeSha1Checksum) Invocations() map[string][][]interface{} { 119 fake.invocationsMutex.RLock() 120 defer fake.invocationsMutex.RUnlock() 121 fake.computeFileSha1Mutex.RLock() 122 defer fake.computeFileSha1Mutex.RUnlock() 123 fake.checkSha1Mutex.RLock() 124 defer fake.checkSha1Mutex.RUnlock() 125 fake.setFilePathMutex.RLock() 126 defer fake.setFilePathMutex.RUnlock() 127 return fake.invocations 128 } 129 130 func (fake *FakeSha1Checksum) recordInvocation(key string, args []interface{}) { 131 fake.invocationsMutex.Lock() 132 defer fake.invocationsMutex.Unlock() 133 if fake.invocations == nil { 134 fake.invocations = map[string][][]interface{}{} 135 } 136 if fake.invocations[key] == nil { 137 fake.invocations[key] = [][]interface{}{} 138 } 139 fake.invocations[key] = append(fake.invocations[key], args) 140 } 141 142 var _ util.Sha1Checksum = new(FakeSha1Checksum)