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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/actors/plugininstaller"
)

type FakePluginInstaller struct {
	InstallStub        func(string) string
	installMutex       sync.RWMutex
	installArgsForCall []struct {
		arg1 string
	}
	installReturns struct {
		result1 string
	}
	installReturnsOnCall map[int]struct {
		result1 string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePluginInstaller) Install(arg1 string) string {
	fake.installMutex.Lock()
	ret, specificReturn := fake.installReturnsOnCall[len(fake.installArgsForCall)]
	fake.installArgsForCall = append(fake.installArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("Install", []interface{}{arg1})
	fake.installMutex.Unlock()
	if fake.InstallStub != nil {
		return fake.InstallStub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.installReturns
	return fakeReturns.result1
}

func (fake *FakePluginInstaller) InstallCallCount() int {
	fake.installMutex.RLock()
	defer fake.installMutex.RUnlock()
	return len(fake.installArgsForCall)
}

func (fake *FakePluginInstaller) InstallCalls(stub func(string) string) {
	fake.installMutex.Lock()
	defer fake.installMutex.Unlock()
	fake.InstallStub = stub
}

func (fake *FakePluginInstaller) InstallArgsForCall(i int) string {
	fake.installMutex.RLock()
	defer fake.installMutex.RUnlock()
	argsForCall := fake.installArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakePluginInstaller) InstallReturns(result1 string) {
	fake.installMutex.Lock()
	defer fake.installMutex.Unlock()
	fake.InstallStub = nil
	fake.installReturns = struct {
		result1 string
	}{result1}
}

func (fake *FakePluginInstaller) InstallReturnsOnCall(i int, result1 string) {
	fake.installMutex.Lock()
	defer fake.installMutex.Unlock()
	fake.InstallStub = nil
	if fake.installReturnsOnCall == nil {
		fake.installReturnsOnCall = make(map[int]struct {
			result1 string
		})
	}
	fake.installReturnsOnCall[i] = struct {
		result1 string
	}{result1}
}

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

func (fake *FakePluginInstaller) 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 _ plugininstaller.PluginInstaller = new(FakePluginInstaller)
