github.com/loafoe/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_space_requirement.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package requirementsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/models" 8 "code.cloudfoundry.org/cli/cf/requirements" 9 ) 10 11 type FakeSpaceRequirement struct { 12 ExecuteStub func() error 13 executeMutex sync.RWMutex 14 executeArgsForCall []struct { 15 } 16 executeReturns struct { 17 result1 error 18 } 19 executeReturnsOnCall map[int]struct { 20 result1 error 21 } 22 GetSpaceStub func() models.Space 23 getSpaceMutex sync.RWMutex 24 getSpaceArgsForCall []struct { 25 } 26 getSpaceReturns struct { 27 result1 models.Space 28 } 29 getSpaceReturnsOnCall map[int]struct { 30 result1 models.Space 31 } 32 SetSpaceNameStub func(string) 33 setSpaceNameMutex sync.RWMutex 34 setSpaceNameArgsForCall []struct { 35 arg1 string 36 } 37 invocations map[string][][]interface{} 38 invocationsMutex sync.RWMutex 39 } 40 41 func (fake *FakeSpaceRequirement) Execute() error { 42 fake.executeMutex.Lock() 43 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 44 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 45 }{}) 46 fake.recordInvocation("Execute", []interface{}{}) 47 fake.executeMutex.Unlock() 48 if fake.ExecuteStub != nil { 49 return fake.ExecuteStub() 50 } 51 if specificReturn { 52 return ret.result1 53 } 54 fakeReturns := fake.executeReturns 55 return fakeReturns.result1 56 } 57 58 func (fake *FakeSpaceRequirement) ExecuteCallCount() int { 59 fake.executeMutex.RLock() 60 defer fake.executeMutex.RUnlock() 61 return len(fake.executeArgsForCall) 62 } 63 64 func (fake *FakeSpaceRequirement) ExecuteCalls(stub func() error) { 65 fake.executeMutex.Lock() 66 defer fake.executeMutex.Unlock() 67 fake.ExecuteStub = stub 68 } 69 70 func (fake *FakeSpaceRequirement) ExecuteReturns(result1 error) { 71 fake.executeMutex.Lock() 72 defer fake.executeMutex.Unlock() 73 fake.ExecuteStub = nil 74 fake.executeReturns = struct { 75 result1 error 76 }{result1} 77 } 78 79 func (fake *FakeSpaceRequirement) ExecuteReturnsOnCall(i int, result1 error) { 80 fake.executeMutex.Lock() 81 defer fake.executeMutex.Unlock() 82 fake.ExecuteStub = nil 83 if fake.executeReturnsOnCall == nil { 84 fake.executeReturnsOnCall = make(map[int]struct { 85 result1 error 86 }) 87 } 88 fake.executeReturnsOnCall[i] = struct { 89 result1 error 90 }{result1} 91 } 92 93 func (fake *FakeSpaceRequirement) GetSpace() models.Space { 94 fake.getSpaceMutex.Lock() 95 ret, specificReturn := fake.getSpaceReturnsOnCall[len(fake.getSpaceArgsForCall)] 96 fake.getSpaceArgsForCall = append(fake.getSpaceArgsForCall, struct { 97 }{}) 98 fake.recordInvocation("GetSpace", []interface{}{}) 99 fake.getSpaceMutex.Unlock() 100 if fake.GetSpaceStub != nil { 101 return fake.GetSpaceStub() 102 } 103 if specificReturn { 104 return ret.result1 105 } 106 fakeReturns := fake.getSpaceReturns 107 return fakeReturns.result1 108 } 109 110 func (fake *FakeSpaceRequirement) GetSpaceCallCount() int { 111 fake.getSpaceMutex.RLock() 112 defer fake.getSpaceMutex.RUnlock() 113 return len(fake.getSpaceArgsForCall) 114 } 115 116 func (fake *FakeSpaceRequirement) GetSpaceCalls(stub func() models.Space) { 117 fake.getSpaceMutex.Lock() 118 defer fake.getSpaceMutex.Unlock() 119 fake.GetSpaceStub = stub 120 } 121 122 func (fake *FakeSpaceRequirement) GetSpaceReturns(result1 models.Space) { 123 fake.getSpaceMutex.Lock() 124 defer fake.getSpaceMutex.Unlock() 125 fake.GetSpaceStub = nil 126 fake.getSpaceReturns = struct { 127 result1 models.Space 128 }{result1} 129 } 130 131 func (fake *FakeSpaceRequirement) GetSpaceReturnsOnCall(i int, result1 models.Space) { 132 fake.getSpaceMutex.Lock() 133 defer fake.getSpaceMutex.Unlock() 134 fake.GetSpaceStub = nil 135 if fake.getSpaceReturnsOnCall == nil { 136 fake.getSpaceReturnsOnCall = make(map[int]struct { 137 result1 models.Space 138 }) 139 } 140 fake.getSpaceReturnsOnCall[i] = struct { 141 result1 models.Space 142 }{result1} 143 } 144 145 func (fake *FakeSpaceRequirement) SetSpaceName(arg1 string) { 146 fake.setSpaceNameMutex.Lock() 147 fake.setSpaceNameArgsForCall = append(fake.setSpaceNameArgsForCall, struct { 148 arg1 string 149 }{arg1}) 150 fake.recordInvocation("SetSpaceName", []interface{}{arg1}) 151 fake.setSpaceNameMutex.Unlock() 152 if fake.SetSpaceNameStub != nil { 153 fake.SetSpaceNameStub(arg1) 154 } 155 } 156 157 func (fake *FakeSpaceRequirement) SetSpaceNameCallCount() int { 158 fake.setSpaceNameMutex.RLock() 159 defer fake.setSpaceNameMutex.RUnlock() 160 return len(fake.setSpaceNameArgsForCall) 161 } 162 163 func (fake *FakeSpaceRequirement) SetSpaceNameCalls(stub func(string)) { 164 fake.setSpaceNameMutex.Lock() 165 defer fake.setSpaceNameMutex.Unlock() 166 fake.SetSpaceNameStub = stub 167 } 168 169 func (fake *FakeSpaceRequirement) SetSpaceNameArgsForCall(i int) string { 170 fake.setSpaceNameMutex.RLock() 171 defer fake.setSpaceNameMutex.RUnlock() 172 argsForCall := fake.setSpaceNameArgsForCall[i] 173 return argsForCall.arg1 174 } 175 176 func (fake *FakeSpaceRequirement) Invocations() map[string][][]interface{} { 177 fake.invocationsMutex.RLock() 178 defer fake.invocationsMutex.RUnlock() 179 fake.executeMutex.RLock() 180 defer fake.executeMutex.RUnlock() 181 fake.getSpaceMutex.RLock() 182 defer fake.getSpaceMutex.RUnlock() 183 fake.setSpaceNameMutex.RLock() 184 defer fake.setSpaceNameMutex.RUnlock() 185 copiedInvocations := map[string][][]interface{}{} 186 for key, value := range fake.invocations { 187 copiedInvocations[key] = value 188 } 189 return copiedInvocations 190 } 191 192 func (fake *FakeSpaceRequirement) recordInvocation(key string, args []interface{}) { 193 fake.invocationsMutex.Lock() 194 defer fake.invocationsMutex.Unlock() 195 if fake.invocations == nil { 196 fake.invocations = map[string][][]interface{}{} 197 } 198 if fake.invocations[key] == nil { 199 fake.invocations[key] = [][]interface{}{} 200 } 201 fake.invocations[key] = append(fake.invocations[key], args) 202 } 203 204 var _ requirements.SpaceRequirement = new(FakeSpaceRequirement)