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

import (
	"sync"

	"code.cloudfoundry.org/cli/util/ui"
	"github.com/vito/go-interact/interact"
)

type FakeInteractor struct {
	NewInteractionStub        func(string, ...interact.Choice) ui.Resolver
	newInteractionMutex       sync.RWMutex
	newInteractionArgsForCall []struct {
		arg1 string
		arg2 []interact.Choice
	}
	newInteractionReturns struct {
		result1 ui.Resolver
	}
	newInteractionReturnsOnCall map[int]struct {
		result1 ui.Resolver
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeInteractor) NewInteraction(arg1 string, arg2 ...interact.Choice) ui.Resolver {
	fake.newInteractionMutex.Lock()
	ret, specificReturn := fake.newInteractionReturnsOnCall[len(fake.newInteractionArgsForCall)]
	fake.newInteractionArgsForCall = append(fake.newInteractionArgsForCall, struct {
		arg1 string
		arg2 []interact.Choice
	}{arg1, arg2})
	stub := fake.NewInteractionStub
	fakeReturns := fake.newInteractionReturns
	fake.recordInvocation("NewInteraction", []interface{}{arg1, arg2})
	fake.newInteractionMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2...)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeInteractor) NewInteractionCallCount() int {
	fake.newInteractionMutex.RLock()
	defer fake.newInteractionMutex.RUnlock()
	return len(fake.newInteractionArgsForCall)
}

func (fake *FakeInteractor) NewInteractionCalls(stub func(string, ...interact.Choice) ui.Resolver) {
	fake.newInteractionMutex.Lock()
	defer fake.newInteractionMutex.Unlock()
	fake.NewInteractionStub = stub
}

func (fake *FakeInteractor) NewInteractionArgsForCall(i int) (string, []interact.Choice) {
	fake.newInteractionMutex.RLock()
	defer fake.newInteractionMutex.RUnlock()
	argsForCall := fake.newInteractionArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeInteractor) NewInteractionReturns(result1 ui.Resolver) {
	fake.newInteractionMutex.Lock()
	defer fake.newInteractionMutex.Unlock()
	fake.NewInteractionStub = nil
	fake.newInteractionReturns = struct {
		result1 ui.Resolver
	}{result1}
}

func (fake *FakeInteractor) NewInteractionReturnsOnCall(i int, result1 ui.Resolver) {
	fake.newInteractionMutex.Lock()
	defer fake.newInteractionMutex.Unlock()
	fake.NewInteractionStub = nil
	if fake.newInteractionReturnsOnCall == nil {
		fake.newInteractionReturnsOnCall = make(map[int]struct {
			result1 ui.Resolver
		})
	}
	fake.newInteractionReturnsOnCall[i] = struct {
		result1 ui.Resolver
	}{result1}
}

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

func (fake *FakeInteractor) 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 _ ui.Interactor = new(FakeInteractor)
