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

import (
	"sync"

	"code.cloudfoundry.org/garden"
	"code.cloudfoundry.org/guardian/rundmc/goci"
	"code.cloudfoundry.org/guardian/rundmc/processes"
)

type FakeEnvDeterminer struct {
	EnvForStub        func(goci.Bndl, garden.ProcessSpec, int) []string
	envForMutex       sync.RWMutex
	envForArgsForCall []struct {
		arg1 goci.Bndl
		arg2 garden.ProcessSpec
		arg3 int
	}
	envForReturns struct {
		result1 []string
	}
	envForReturnsOnCall map[int]struct {
		result1 []string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeEnvDeterminer) EnvFor(arg1 goci.Bndl, arg2 garden.ProcessSpec, arg3 int) []string {
	fake.envForMutex.Lock()
	ret, specificReturn := fake.envForReturnsOnCall[len(fake.envForArgsForCall)]
	fake.envForArgsForCall = append(fake.envForArgsForCall, struct {
		arg1 goci.Bndl
		arg2 garden.ProcessSpec
		arg3 int
	}{arg1, arg2, arg3})
	fake.recordInvocation("EnvFor", []interface{}{arg1, arg2, arg3})
	fake.envForMutex.Unlock()
	if fake.EnvForStub != nil {
		return fake.EnvForStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.envForReturns
	return fakeReturns.result1
}

func (fake *FakeEnvDeterminer) EnvForCallCount() int {
	fake.envForMutex.RLock()
	defer fake.envForMutex.RUnlock()
	return len(fake.envForArgsForCall)
}

func (fake *FakeEnvDeterminer) EnvForCalls(stub func(goci.Bndl, garden.ProcessSpec, int) []string) {
	fake.envForMutex.Lock()
	defer fake.envForMutex.Unlock()
	fake.EnvForStub = stub
}

func (fake *FakeEnvDeterminer) EnvForArgsForCall(i int) (goci.Bndl, garden.ProcessSpec, int) {
	fake.envForMutex.RLock()
	defer fake.envForMutex.RUnlock()
	argsForCall := fake.envForArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeEnvDeterminer) EnvForReturns(result1 []string) {
	fake.envForMutex.Lock()
	defer fake.envForMutex.Unlock()
	fake.EnvForStub = nil
	fake.envForReturns = struct {
		result1 []string
	}{result1}
}

func (fake *FakeEnvDeterminer) EnvForReturnsOnCall(i int, result1 []string) {
	fake.envForMutex.Lock()
	defer fake.envForMutex.Unlock()
	fake.EnvForStub = nil
	if fake.envForReturnsOnCall == nil {
		fake.envForReturnsOnCall = make(map[int]struct {
			result1 []string
		})
	}
	fake.envForReturnsOnCall[i] = struct {
		result1 []string
	}{result1}
}

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

func (fake *FakeEnvDeterminer) 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 _ processes.EnvDeterminer = new(FakeEnvDeterminer)
