github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/cf/commands/application/applicationfakes/fake_displayer.go (about) 1 // This file was generated by counterfeiter 2 package applicationfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/commands/application" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeDisplayer struct { 12 ShowAppStub func(app models.Application, orgName string, spaceName string) error 13 showAppMutex sync.RWMutex 14 showAppArgsForCall []struct { 15 app models.Application 16 orgName string 17 spaceName string 18 } 19 showAppReturns struct { 20 result1 error 21 } 22 invocations map[string][][]interface{} 23 invocationsMutex sync.RWMutex 24 } 25 26 func (fake *FakeDisplayer) ShowApp(app models.Application, orgName string, spaceName string) error { 27 fake.showAppMutex.Lock() 28 fake.showAppArgsForCall = append(fake.showAppArgsForCall, struct { 29 app models.Application 30 orgName string 31 spaceName string 32 }{app, orgName, spaceName}) 33 fake.recordInvocation("ShowApp", []interface{}{app, orgName, spaceName}) 34 fake.showAppMutex.Unlock() 35 if fake.ShowAppStub != nil { 36 return fake.ShowAppStub(app, orgName, spaceName) 37 } else { 38 return fake.showAppReturns.result1 39 } 40 } 41 42 func (fake *FakeDisplayer) ShowAppCallCount() int { 43 fake.showAppMutex.RLock() 44 defer fake.showAppMutex.RUnlock() 45 return len(fake.showAppArgsForCall) 46 } 47 48 func (fake *FakeDisplayer) ShowAppArgsForCall(i int) (models.Application, string, string) { 49 fake.showAppMutex.RLock() 50 defer fake.showAppMutex.RUnlock() 51 return fake.showAppArgsForCall[i].app, fake.showAppArgsForCall[i].orgName, fake.showAppArgsForCall[i].spaceName 52 } 53 54 func (fake *FakeDisplayer) ShowAppReturns(result1 error) { 55 fake.ShowAppStub = nil 56 fake.showAppReturns = struct { 57 result1 error 58 }{result1} 59 } 60 61 func (fake *FakeDisplayer) Invocations() map[string][][]interface{} { 62 fake.invocationsMutex.RLock() 63 defer fake.invocationsMutex.RUnlock() 64 fake.showAppMutex.RLock() 65 defer fake.showAppMutex.RUnlock() 66 return fake.invocations 67 } 68 69 func (fake *FakeDisplayer) recordInvocation(key string, args []interface{}) { 70 fake.invocationsMutex.Lock() 71 defer fake.invocationsMutex.Unlock() 72 if fake.invocations == nil { 73 fake.invocations = map[string][][]interface{}{} 74 } 75 if fake.invocations[key] == nil { 76 fake.invocations[key] = [][]interface{}{} 77 } 78 fake.invocations[key] = append(fake.invocations[key], args) 79 } 80 81 var _ application.Displayer = new(FakeDisplayer)