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

import (
	"sync"

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

type FakeRuntimeStater struct {
	StateStub        func(lager.Logger, string) (rundmc.State, error)
	stateMutex       sync.RWMutex
	stateArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	stateReturns struct {
		result1 rundmc.State
		result2 error
	}
	stateReturnsOnCall map[int]struct {
		result1 rundmc.State
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRuntimeStater) State(arg1 lager.Logger, arg2 string) (rundmc.State, error) {
	fake.stateMutex.Lock()
	ret, specificReturn := fake.stateReturnsOnCall[len(fake.stateArgsForCall)]
	fake.stateArgsForCall = append(fake.stateArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("State", []interface{}{arg1, arg2})
	fake.stateMutex.Unlock()
	if fake.StateStub != nil {
		return fake.StateStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.stateReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRuntimeStater) StateCallCount() int {
	fake.stateMutex.RLock()
	defer fake.stateMutex.RUnlock()
	return len(fake.stateArgsForCall)
}

func (fake *FakeRuntimeStater) StateCalls(stub func(lager.Logger, string) (rundmc.State, error)) {
	fake.stateMutex.Lock()
	defer fake.stateMutex.Unlock()
	fake.StateStub = stub
}

func (fake *FakeRuntimeStater) StateArgsForCall(i int) (lager.Logger, string) {
	fake.stateMutex.RLock()
	defer fake.stateMutex.RUnlock()
	argsForCall := fake.stateArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeRuntimeStater) StateReturns(result1 rundmc.State, result2 error) {
	fake.stateMutex.Lock()
	defer fake.stateMutex.Unlock()
	fake.StateStub = nil
	fake.stateReturns = struct {
		result1 rundmc.State
		result2 error
	}{result1, result2}
}

func (fake *FakeRuntimeStater) StateReturnsOnCall(i int, result1 rundmc.State, result2 error) {
	fake.stateMutex.Lock()
	defer fake.stateMutex.Unlock()
	fake.StateStub = nil
	if fake.stateReturnsOnCall == nil {
		fake.stateReturnsOnCall = make(map[int]struct {
			result1 rundmc.State
			result2 error
		})
	}
	fake.stateReturnsOnCall[i] = struct {
		result1 rundmc.State
		result2 error
	}{result1, result2}
}

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

func (fake *FakeRuntimeStater) 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 _ deleter.RuntimeStater = new(FakeRuntimeStater)
