// Code generated by counterfeiter. DO NOT EDIT.
package passwordfakes

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api/password"
)

type FakeRepository struct {
	UpdatePasswordStub        func(string, string) error
	updatePasswordMutex       sync.RWMutex
	updatePasswordArgsForCall []struct {
		arg1 string
		arg2 string
	}
	updatePasswordReturns struct {
		result1 error
	}
	updatePasswordReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRepository) UpdatePassword(arg1 string, arg2 string) error {
	fake.updatePasswordMutex.Lock()
	ret, specificReturn := fake.updatePasswordReturnsOnCall[len(fake.updatePasswordArgsForCall)]
	fake.updatePasswordArgsForCall = append(fake.updatePasswordArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("UpdatePassword", []interface{}{arg1, arg2})
	fake.updatePasswordMutex.Unlock()
	if fake.UpdatePasswordStub != nil {
		return fake.UpdatePasswordStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.updatePasswordReturns
	return fakeReturns.result1
}

func (fake *FakeRepository) UpdatePasswordCallCount() int {
	fake.updatePasswordMutex.RLock()
	defer fake.updatePasswordMutex.RUnlock()
	return len(fake.updatePasswordArgsForCall)
}

func (fake *FakeRepository) UpdatePasswordCalls(stub func(string, string) error) {
	fake.updatePasswordMutex.Lock()
	defer fake.updatePasswordMutex.Unlock()
	fake.UpdatePasswordStub = stub
}

func (fake *FakeRepository) UpdatePasswordArgsForCall(i int) (string, string) {
	fake.updatePasswordMutex.RLock()
	defer fake.updatePasswordMutex.RUnlock()
	argsForCall := fake.updatePasswordArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeRepository) UpdatePasswordReturns(result1 error) {
	fake.updatePasswordMutex.Lock()
	defer fake.updatePasswordMutex.Unlock()
	fake.UpdatePasswordStub = nil
	fake.updatePasswordReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) UpdatePasswordReturnsOnCall(i int, result1 error) {
	fake.updatePasswordMutex.Lock()
	defer fake.updatePasswordMutex.Unlock()
	fake.UpdatePasswordStub = nil
	if fake.updatePasswordReturnsOnCall == nil {
		fake.updatePasswordReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.updatePasswordReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeRepository) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.updatePasswordMutex.RLock()
	defer fake.updatePasswordMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeRepository) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ password.Repository = new(FakeRepository)
