github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/v2fakes/fake_auth_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2fakes 3 4 import ( 5 "sync" 6 7 "github.com/liamawhite/cli-with-i18n/actor/v2action" 8 "github.com/liamawhite/cli-with-i18n/command/v2" 9 ) 10 11 type FakeAuthActor struct { 12 AuthenticateStub func(config v2action.Config, username string, password string) error 13 authenticateMutex sync.RWMutex 14 authenticateArgsForCall []struct { 15 config v2action.Config 16 username string 17 password string 18 } 19 authenticateReturns struct { 20 result1 error 21 } 22 authenticateReturnsOnCall map[int]struct { 23 result1 error 24 } 25 invocations map[string][][]interface{} 26 invocationsMutex sync.RWMutex 27 } 28 29 func (fake *FakeAuthActor) Authenticate(config v2action.Config, username string, password string) error { 30 fake.authenticateMutex.Lock() 31 ret, specificReturn := fake.authenticateReturnsOnCall[len(fake.authenticateArgsForCall)] 32 fake.authenticateArgsForCall = append(fake.authenticateArgsForCall, struct { 33 config v2action.Config 34 username string 35 password string 36 }{config, username, password}) 37 fake.recordInvocation("Authenticate", []interface{}{config, username, password}) 38 fake.authenticateMutex.Unlock() 39 if fake.AuthenticateStub != nil { 40 return fake.AuthenticateStub(config, username, password) 41 } 42 if specificReturn { 43 return ret.result1 44 } 45 return fake.authenticateReturns.result1 46 } 47 48 func (fake *FakeAuthActor) AuthenticateCallCount() int { 49 fake.authenticateMutex.RLock() 50 defer fake.authenticateMutex.RUnlock() 51 return len(fake.authenticateArgsForCall) 52 } 53 54 func (fake *FakeAuthActor) AuthenticateArgsForCall(i int) (v2action.Config, string, string) { 55 fake.authenticateMutex.RLock() 56 defer fake.authenticateMutex.RUnlock() 57 return fake.authenticateArgsForCall[i].config, fake.authenticateArgsForCall[i].username, fake.authenticateArgsForCall[i].password 58 } 59 60 func (fake *FakeAuthActor) AuthenticateReturns(result1 error) { 61 fake.AuthenticateStub = nil 62 fake.authenticateReturns = struct { 63 result1 error 64 }{result1} 65 } 66 67 func (fake *FakeAuthActor) AuthenticateReturnsOnCall(i int, result1 error) { 68 fake.AuthenticateStub = nil 69 if fake.authenticateReturnsOnCall == nil { 70 fake.authenticateReturnsOnCall = make(map[int]struct { 71 result1 error 72 }) 73 } 74 fake.authenticateReturnsOnCall[i] = struct { 75 result1 error 76 }{result1} 77 } 78 79 func (fake *FakeAuthActor) Invocations() map[string][][]interface{} { 80 fake.invocationsMutex.RLock() 81 defer fake.invocationsMutex.RUnlock() 82 fake.authenticateMutex.RLock() 83 defer fake.authenticateMutex.RUnlock() 84 copiedInvocations := map[string][][]interface{}{} 85 for key, value := range fake.invocations { 86 copiedInvocations[key] = value 87 } 88 return copiedInvocations 89 } 90 91 func (fake *FakeAuthActor) recordInvocation(key string, args []interface{}) { 92 fake.invocationsMutex.Lock() 93 defer fake.invocationsMutex.Unlock() 94 if fake.invocations == nil { 95 fake.invocations = map[string][][]interface{}{} 96 } 97 if fake.invocations[key] == nil { 98 fake.invocations[key] = [][]interface{}{} 99 } 100 fake.invocations[key] = append(fake.invocations[key], args) 101 } 102 103 var _ v2.AuthActor = new(FakeAuthActor)