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

import (
	"sync"

	"code.cloudfoundry.org/cli/util/configv3"
)

type FakeUserConfig struct {
	CurrentUserStub        func() (configv3.User, error)
	currentUserMutex       sync.RWMutex
	currentUserArgsForCall []struct {
	}
	currentUserReturns struct {
		result1 configv3.User
		result2 error
	}
	currentUserReturnsOnCall map[int]struct {
		result1 configv3.User
		result2 error
	}
	CurrentUserNameStub        func() (string, error)
	currentUserNameMutex       sync.RWMutex
	currentUserNameArgsForCall []struct {
	}
	currentUserNameReturns struct {
		result1 string
		result2 error
	}
	currentUserNameReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeUserConfig) CurrentUser() (configv3.User, error) {
	fake.currentUserMutex.Lock()
	ret, specificReturn := fake.currentUserReturnsOnCall[len(fake.currentUserArgsForCall)]
	fake.currentUserArgsForCall = append(fake.currentUserArgsForCall, struct {
	}{})
	fake.recordInvocation("CurrentUser", []interface{}{})
	fake.currentUserMutex.Unlock()
	if fake.CurrentUserStub != nil {
		return fake.CurrentUserStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.currentUserReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeUserConfig) CurrentUserCallCount() int {
	fake.currentUserMutex.RLock()
	defer fake.currentUserMutex.RUnlock()
	return len(fake.currentUserArgsForCall)
}

func (fake *FakeUserConfig) CurrentUserCalls(stub func() (configv3.User, error)) {
	fake.currentUserMutex.Lock()
	defer fake.currentUserMutex.Unlock()
	fake.CurrentUserStub = stub
}

func (fake *FakeUserConfig) CurrentUserReturns(result1 configv3.User, result2 error) {
	fake.currentUserMutex.Lock()
	defer fake.currentUserMutex.Unlock()
	fake.CurrentUserStub = nil
	fake.currentUserReturns = struct {
		result1 configv3.User
		result2 error
	}{result1, result2}
}

func (fake *FakeUserConfig) CurrentUserReturnsOnCall(i int, result1 configv3.User, result2 error) {
	fake.currentUserMutex.Lock()
	defer fake.currentUserMutex.Unlock()
	fake.CurrentUserStub = nil
	if fake.currentUserReturnsOnCall == nil {
		fake.currentUserReturnsOnCall = make(map[int]struct {
			result1 configv3.User
			result2 error
		})
	}
	fake.currentUserReturnsOnCall[i] = struct {
		result1 configv3.User
		result2 error
	}{result1, result2}
}

func (fake *FakeUserConfig) CurrentUserName() (string, error) {
	fake.currentUserNameMutex.Lock()
	ret, specificReturn := fake.currentUserNameReturnsOnCall[len(fake.currentUserNameArgsForCall)]
	fake.currentUserNameArgsForCall = append(fake.currentUserNameArgsForCall, struct {
	}{})
	fake.recordInvocation("CurrentUserName", []interface{}{})
	fake.currentUserNameMutex.Unlock()
	if fake.CurrentUserNameStub != nil {
		return fake.CurrentUserNameStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.currentUserNameReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeUserConfig) CurrentUserNameCallCount() int {
	fake.currentUserNameMutex.RLock()
	defer fake.currentUserNameMutex.RUnlock()
	return len(fake.currentUserNameArgsForCall)
}

func (fake *FakeUserConfig) CurrentUserNameCalls(stub func() (string, error)) {
	fake.currentUserNameMutex.Lock()
	defer fake.currentUserNameMutex.Unlock()
	fake.CurrentUserNameStub = stub
}

func (fake *FakeUserConfig) CurrentUserNameReturns(result1 string, result2 error) {
	fake.currentUserNameMutex.Lock()
	defer fake.currentUserNameMutex.Unlock()
	fake.CurrentUserNameStub = nil
	fake.currentUserNameReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeUserConfig) CurrentUserNameReturnsOnCall(i int, result1 string, result2 error) {
	fake.currentUserNameMutex.Lock()
	defer fake.currentUserNameMutex.Unlock()
	fake.CurrentUserNameStub = nil
	if fake.currentUserNameReturnsOnCall == nil {
		fake.currentUserNameReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.currentUserNameReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

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

func (fake *FakeUserConfig) 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 _ configv3.UserConfig = new(FakeUserConfig)
