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

import (
	"sync"

	"code.cloudfoundry.org/cli/command"
	v7 "code.cloudfoundry.org/cli/command/v7"
)

type FakeActorReloader struct {
	ReloadStub        func(command.Config, command.UI) (v7.Actor, error)
	reloadMutex       sync.RWMutex
	reloadArgsForCall []struct {
		arg1 command.Config
		arg2 command.UI
	}
	reloadReturns struct {
		result1 v7.Actor
		result2 error
	}
	reloadReturnsOnCall map[int]struct {
		result1 v7.Actor
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeActorReloader) Reload(arg1 command.Config, arg2 command.UI) (v7.Actor, error) {
	fake.reloadMutex.Lock()
	ret, specificReturn := fake.reloadReturnsOnCall[len(fake.reloadArgsForCall)]
	fake.reloadArgsForCall = append(fake.reloadArgsForCall, struct {
		arg1 command.Config
		arg2 command.UI
	}{arg1, arg2})
	fake.recordInvocation("Reload", []interface{}{arg1, arg2})
	fake.reloadMutex.Unlock()
	if fake.ReloadStub != nil {
		return fake.ReloadStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.reloadReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeActorReloader) ReloadCallCount() int {
	fake.reloadMutex.RLock()
	defer fake.reloadMutex.RUnlock()
	return len(fake.reloadArgsForCall)
}

func (fake *FakeActorReloader) ReloadCalls(stub func(command.Config, command.UI) (v7.Actor, error)) {
	fake.reloadMutex.Lock()
	defer fake.reloadMutex.Unlock()
	fake.ReloadStub = stub
}

func (fake *FakeActorReloader) ReloadArgsForCall(i int) (command.Config, command.UI) {
	fake.reloadMutex.RLock()
	defer fake.reloadMutex.RUnlock()
	argsForCall := fake.reloadArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeActorReloader) ReloadReturns(result1 v7.Actor, result2 error) {
	fake.reloadMutex.Lock()
	defer fake.reloadMutex.Unlock()
	fake.ReloadStub = nil
	fake.reloadReturns = struct {
		result1 v7.Actor
		result2 error
	}{result1, result2}
}

func (fake *FakeActorReloader) ReloadReturnsOnCall(i int, result1 v7.Actor, result2 error) {
	fake.reloadMutex.Lock()
	defer fake.reloadMutex.Unlock()
	fake.ReloadStub = nil
	if fake.reloadReturnsOnCall == nil {
		fake.reloadReturnsOnCall = make(map[int]struct {
			result1 v7.Actor
			result2 error
		})
	}
	fake.reloadReturnsOnCall[i] = struct {
		result1 v7.Actor
		result2 error
	}{result1, result2}
}

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

func (fake *FakeActorReloader) 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 _ v7.ActorReloader = new(FakeActorReloader)
