github.com/loafoe/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_user_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 FakeUserRequirement 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 GetUserStub func() models.UserFields 23 getUserMutex sync.RWMutex 24 getUserArgsForCall []struct { 25 } 26 getUserReturns struct { 27 result1 models.UserFields 28 } 29 getUserReturnsOnCall map[int]struct { 30 result1 models.UserFields 31 } 32 invocations map[string][][]interface{} 33 invocationsMutex sync.RWMutex 34 } 35 36 func (fake *FakeUserRequirement) Execute() error { 37 fake.executeMutex.Lock() 38 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 39 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 40 }{}) 41 fake.recordInvocation("Execute", []interface{}{}) 42 fake.executeMutex.Unlock() 43 if fake.ExecuteStub != nil { 44 return fake.ExecuteStub() 45 } 46 if specificReturn { 47 return ret.result1 48 } 49 fakeReturns := fake.executeReturns 50 return fakeReturns.result1 51 } 52 53 func (fake *FakeUserRequirement) ExecuteCallCount() int { 54 fake.executeMutex.RLock() 55 defer fake.executeMutex.RUnlock() 56 return len(fake.executeArgsForCall) 57 } 58 59 func (fake *FakeUserRequirement) ExecuteCalls(stub func() error) { 60 fake.executeMutex.Lock() 61 defer fake.executeMutex.Unlock() 62 fake.ExecuteStub = stub 63 } 64 65 func (fake *FakeUserRequirement) ExecuteReturns(result1 error) { 66 fake.executeMutex.Lock() 67 defer fake.executeMutex.Unlock() 68 fake.ExecuteStub = nil 69 fake.executeReturns = struct { 70 result1 error 71 }{result1} 72 } 73 74 func (fake *FakeUserRequirement) ExecuteReturnsOnCall(i int, result1 error) { 75 fake.executeMutex.Lock() 76 defer fake.executeMutex.Unlock() 77 fake.ExecuteStub = nil 78 if fake.executeReturnsOnCall == nil { 79 fake.executeReturnsOnCall = make(map[int]struct { 80 result1 error 81 }) 82 } 83 fake.executeReturnsOnCall[i] = struct { 84 result1 error 85 }{result1} 86 } 87 88 func (fake *FakeUserRequirement) GetUser() models.UserFields { 89 fake.getUserMutex.Lock() 90 ret, specificReturn := fake.getUserReturnsOnCall[len(fake.getUserArgsForCall)] 91 fake.getUserArgsForCall = append(fake.getUserArgsForCall, struct { 92 }{}) 93 fake.recordInvocation("GetUser", []interface{}{}) 94 fake.getUserMutex.Unlock() 95 if fake.GetUserStub != nil { 96 return fake.GetUserStub() 97 } 98 if specificReturn { 99 return ret.result1 100 } 101 fakeReturns := fake.getUserReturns 102 return fakeReturns.result1 103 } 104 105 func (fake *FakeUserRequirement) GetUserCallCount() int { 106 fake.getUserMutex.RLock() 107 defer fake.getUserMutex.RUnlock() 108 return len(fake.getUserArgsForCall) 109 } 110 111 func (fake *FakeUserRequirement) GetUserCalls(stub func() models.UserFields) { 112 fake.getUserMutex.Lock() 113 defer fake.getUserMutex.Unlock() 114 fake.GetUserStub = stub 115 } 116 117 func (fake *FakeUserRequirement) GetUserReturns(result1 models.UserFields) { 118 fake.getUserMutex.Lock() 119 defer fake.getUserMutex.Unlock() 120 fake.GetUserStub = nil 121 fake.getUserReturns = struct { 122 result1 models.UserFields 123 }{result1} 124 } 125 126 func (fake *FakeUserRequirement) GetUserReturnsOnCall(i int, result1 models.UserFields) { 127 fake.getUserMutex.Lock() 128 defer fake.getUserMutex.Unlock() 129 fake.GetUserStub = nil 130 if fake.getUserReturnsOnCall == nil { 131 fake.getUserReturnsOnCall = make(map[int]struct { 132 result1 models.UserFields 133 }) 134 } 135 fake.getUserReturnsOnCall[i] = struct { 136 result1 models.UserFields 137 }{result1} 138 } 139 140 func (fake *FakeUserRequirement) Invocations() map[string][][]interface{} { 141 fake.invocationsMutex.RLock() 142 defer fake.invocationsMutex.RUnlock() 143 fake.executeMutex.RLock() 144 defer fake.executeMutex.RUnlock() 145 fake.getUserMutex.RLock() 146 defer fake.getUserMutex.RUnlock() 147 copiedInvocations := map[string][][]interface{}{} 148 for key, value := range fake.invocations { 149 copiedInvocations[key] = value 150 } 151 return copiedInvocations 152 } 153 154 func (fake *FakeUserRequirement) recordInvocation(key string, args []interface{}) { 155 fake.invocationsMutex.Lock() 156 defer fake.invocationsMutex.Unlock() 157 if fake.invocations == nil { 158 fake.invocations = map[string][][]interface{}{} 159 } 160 if fake.invocations[key] == nil { 161 fake.invocations[key] = [][]interface{}{} 162 } 163 fake.invocations[key] = append(fake.invocations[key], args) 164 } 165 166 var _ requirements.UserRequirement = new(FakeUserRequirement)