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

import (
	"sync"

	"code.cloudfoundry.org/guardian/rundmc/runrunc"
	"code.cloudfoundry.org/lager/v3"
)

type FakeRuncCmdRunner struct {
	RunAndLogStub        func(lager.Logger, runrunc.LoggingCmd) error
	runAndLogMutex       sync.RWMutex
	runAndLogArgsForCall []struct {
		arg1 lager.Logger
		arg2 runrunc.LoggingCmd
	}
	runAndLogReturns struct {
		result1 error
	}
	runAndLogReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRuncCmdRunner) RunAndLog(arg1 lager.Logger, arg2 runrunc.LoggingCmd) error {
	fake.runAndLogMutex.Lock()
	ret, specificReturn := fake.runAndLogReturnsOnCall[len(fake.runAndLogArgsForCall)]
	fake.runAndLogArgsForCall = append(fake.runAndLogArgsForCall, struct {
		arg1 lager.Logger
		arg2 runrunc.LoggingCmd
	}{arg1, arg2})
	fake.recordInvocation("RunAndLog", []interface{}{arg1, arg2})
	fake.runAndLogMutex.Unlock()
	if fake.RunAndLogStub != nil {
		return fake.RunAndLogStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.runAndLogReturns
	return fakeReturns.result1
}

func (fake *FakeRuncCmdRunner) RunAndLogCallCount() int {
	fake.runAndLogMutex.RLock()
	defer fake.runAndLogMutex.RUnlock()
	return len(fake.runAndLogArgsForCall)
}

func (fake *FakeRuncCmdRunner) RunAndLogCalls(stub func(lager.Logger, runrunc.LoggingCmd) error) {
	fake.runAndLogMutex.Lock()
	defer fake.runAndLogMutex.Unlock()
	fake.RunAndLogStub = stub
}

func (fake *FakeRuncCmdRunner) RunAndLogArgsForCall(i int) (lager.Logger, runrunc.LoggingCmd) {
	fake.runAndLogMutex.RLock()
	defer fake.runAndLogMutex.RUnlock()
	argsForCall := fake.runAndLogArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeRuncCmdRunner) RunAndLogReturns(result1 error) {
	fake.runAndLogMutex.Lock()
	defer fake.runAndLogMutex.Unlock()
	fake.RunAndLogStub = nil
	fake.runAndLogReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeRuncCmdRunner) RunAndLogReturnsOnCall(i int, result1 error) {
	fake.runAndLogMutex.Lock()
	defer fake.runAndLogMutex.Unlock()
	fake.RunAndLogStub = nil
	if fake.runAndLogReturnsOnCall == nil {
		fake.runAndLogReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.runAndLogReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeRuncCmdRunner) 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 _ runrunc.RuncCmdRunner = new(FakeRuncCmdRunner)
