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

import (
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/core/execution"
	"github.com/ehsaniara/joblet/internal/joblet/domain"
)

type FakeEnvironmentManager struct {
	BuildEnvironmentStub        func(*domain.Job, string) []string
	buildEnvironmentMutex       sync.RWMutex
	buildEnvironmentArgsForCall []struct {
		arg1 *domain.Job
		arg2 string
	}
	buildEnvironmentReturns struct {
		result1 []string
	}
	buildEnvironmentReturnsOnCall map[int]struct {
		result1 []string
	}
	CleanupWorkspaceStub        func(string) error
	cleanupWorkspaceMutex       sync.RWMutex
	cleanupWorkspaceArgsForCall []struct {
		arg1 string
	}
	cleanupWorkspaceReturns struct {
		result1 error
	}
	cleanupWorkspaceReturnsOnCall map[int]struct {
		result1 error
	}
	DetectCUDAStub        func() ([]string, error)
	detectCUDAMutex       sync.RWMutex
	detectCUDAArgsForCall []struct {
	}
	detectCUDAReturns struct {
		result1 []string
		result2 error
	}
	detectCUDAReturnsOnCall map[int]struct {
		result1 []string
		result2 error
	}
	GetCUDAEnvironmentStub        func(string) map[string]string
	getCUDAEnvironmentMutex       sync.RWMutex
	getCUDAEnvironmentArgsForCall []struct {
		arg1 string
	}
	getCUDAEnvironmentReturns struct {
		result1 map[string]string
	}
	getCUDAEnvironmentReturnsOnCall map[int]struct {
		result1 map[string]string
	}
	PrepareWorkspaceStub        func(string, []domain.FileUpload) (string, error)
	prepareWorkspaceMutex       sync.RWMutex
	prepareWorkspaceArgsForCall []struct {
		arg1 string
		arg2 []domain.FileUpload
	}
	prepareWorkspaceReturns struct {
		result1 string
		result2 error
	}
	prepareWorkspaceReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeEnvironmentManager) BuildEnvironment(arg1 *domain.Job, arg2 string) []string {
	fake.buildEnvironmentMutex.Lock()
	ret, specificReturn := fake.buildEnvironmentReturnsOnCall[len(fake.buildEnvironmentArgsForCall)]
	fake.buildEnvironmentArgsForCall = append(fake.buildEnvironmentArgsForCall, struct {
		arg1 *domain.Job
		arg2 string
	}{arg1, arg2})
	stub := fake.BuildEnvironmentStub
	fakeReturns := fake.buildEnvironmentReturns
	fake.recordInvocation("BuildEnvironment", []interface{}{arg1, arg2})
	fake.buildEnvironmentMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEnvironmentManager) BuildEnvironmentCallCount() int {
	fake.buildEnvironmentMutex.RLock()
	defer fake.buildEnvironmentMutex.RUnlock()
	return len(fake.buildEnvironmentArgsForCall)
}

func (fake *FakeEnvironmentManager) BuildEnvironmentCalls(stub func(*domain.Job, string) []string) {
	fake.buildEnvironmentMutex.Lock()
	defer fake.buildEnvironmentMutex.Unlock()
	fake.BuildEnvironmentStub = stub
}

func (fake *FakeEnvironmentManager) BuildEnvironmentArgsForCall(i int) (*domain.Job, string) {
	fake.buildEnvironmentMutex.RLock()
	defer fake.buildEnvironmentMutex.RUnlock()
	argsForCall := fake.buildEnvironmentArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeEnvironmentManager) BuildEnvironmentReturns(result1 []string) {
	fake.buildEnvironmentMutex.Lock()
	defer fake.buildEnvironmentMutex.Unlock()
	fake.BuildEnvironmentStub = nil
	fake.buildEnvironmentReturns = struct {
		result1 []string
	}{result1}
}

func (fake *FakeEnvironmentManager) BuildEnvironmentReturnsOnCall(i int, result1 []string) {
	fake.buildEnvironmentMutex.Lock()
	defer fake.buildEnvironmentMutex.Unlock()
	fake.BuildEnvironmentStub = nil
	if fake.buildEnvironmentReturnsOnCall == nil {
		fake.buildEnvironmentReturnsOnCall = make(map[int]struct {
			result1 []string
		})
	}
	fake.buildEnvironmentReturnsOnCall[i] = struct {
		result1 []string
	}{result1}
}

func (fake *FakeEnvironmentManager) CleanupWorkspace(arg1 string) error {
	fake.cleanupWorkspaceMutex.Lock()
	ret, specificReturn := fake.cleanupWorkspaceReturnsOnCall[len(fake.cleanupWorkspaceArgsForCall)]
	fake.cleanupWorkspaceArgsForCall = append(fake.cleanupWorkspaceArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.CleanupWorkspaceStub
	fakeReturns := fake.cleanupWorkspaceReturns
	fake.recordInvocation("CleanupWorkspace", []interface{}{arg1})
	fake.cleanupWorkspaceMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEnvironmentManager) CleanupWorkspaceCallCount() int {
	fake.cleanupWorkspaceMutex.RLock()
	defer fake.cleanupWorkspaceMutex.RUnlock()
	return len(fake.cleanupWorkspaceArgsForCall)
}

func (fake *FakeEnvironmentManager) CleanupWorkspaceCalls(stub func(string) error) {
	fake.cleanupWorkspaceMutex.Lock()
	defer fake.cleanupWorkspaceMutex.Unlock()
	fake.CleanupWorkspaceStub = stub
}

func (fake *FakeEnvironmentManager) CleanupWorkspaceArgsForCall(i int) string {
	fake.cleanupWorkspaceMutex.RLock()
	defer fake.cleanupWorkspaceMutex.RUnlock()
	argsForCall := fake.cleanupWorkspaceArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEnvironmentManager) CleanupWorkspaceReturns(result1 error) {
	fake.cleanupWorkspaceMutex.Lock()
	defer fake.cleanupWorkspaceMutex.Unlock()
	fake.CleanupWorkspaceStub = nil
	fake.cleanupWorkspaceReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEnvironmentManager) CleanupWorkspaceReturnsOnCall(i int, result1 error) {
	fake.cleanupWorkspaceMutex.Lock()
	defer fake.cleanupWorkspaceMutex.Unlock()
	fake.CleanupWorkspaceStub = nil
	if fake.cleanupWorkspaceReturnsOnCall == nil {
		fake.cleanupWorkspaceReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.cleanupWorkspaceReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeEnvironmentManager) DetectCUDA() ([]string, error) {
	fake.detectCUDAMutex.Lock()
	ret, specificReturn := fake.detectCUDAReturnsOnCall[len(fake.detectCUDAArgsForCall)]
	fake.detectCUDAArgsForCall = append(fake.detectCUDAArgsForCall, struct {
	}{})
	stub := fake.DetectCUDAStub
	fakeReturns := fake.detectCUDAReturns
	fake.recordInvocation("DetectCUDA", []interface{}{})
	fake.detectCUDAMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeEnvironmentManager) DetectCUDACallCount() int {
	fake.detectCUDAMutex.RLock()
	defer fake.detectCUDAMutex.RUnlock()
	return len(fake.detectCUDAArgsForCall)
}

func (fake *FakeEnvironmentManager) DetectCUDACalls(stub func() ([]string, error)) {
	fake.detectCUDAMutex.Lock()
	defer fake.detectCUDAMutex.Unlock()
	fake.DetectCUDAStub = stub
}

func (fake *FakeEnvironmentManager) DetectCUDAReturns(result1 []string, result2 error) {
	fake.detectCUDAMutex.Lock()
	defer fake.detectCUDAMutex.Unlock()
	fake.DetectCUDAStub = nil
	fake.detectCUDAReturns = struct {
		result1 []string
		result2 error
	}{result1, result2}
}

func (fake *FakeEnvironmentManager) DetectCUDAReturnsOnCall(i int, result1 []string, result2 error) {
	fake.detectCUDAMutex.Lock()
	defer fake.detectCUDAMutex.Unlock()
	fake.DetectCUDAStub = nil
	if fake.detectCUDAReturnsOnCall == nil {
		fake.detectCUDAReturnsOnCall = make(map[int]struct {
			result1 []string
			result2 error
		})
	}
	fake.detectCUDAReturnsOnCall[i] = struct {
		result1 []string
		result2 error
	}{result1, result2}
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironment(arg1 string) map[string]string {
	fake.getCUDAEnvironmentMutex.Lock()
	ret, specificReturn := fake.getCUDAEnvironmentReturnsOnCall[len(fake.getCUDAEnvironmentArgsForCall)]
	fake.getCUDAEnvironmentArgsForCall = append(fake.getCUDAEnvironmentArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.GetCUDAEnvironmentStub
	fakeReturns := fake.getCUDAEnvironmentReturns
	fake.recordInvocation("GetCUDAEnvironment", []interface{}{arg1})
	fake.getCUDAEnvironmentMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironmentCallCount() int {
	fake.getCUDAEnvironmentMutex.RLock()
	defer fake.getCUDAEnvironmentMutex.RUnlock()
	return len(fake.getCUDAEnvironmentArgsForCall)
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironmentCalls(stub func(string) map[string]string) {
	fake.getCUDAEnvironmentMutex.Lock()
	defer fake.getCUDAEnvironmentMutex.Unlock()
	fake.GetCUDAEnvironmentStub = stub
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironmentArgsForCall(i int) string {
	fake.getCUDAEnvironmentMutex.RLock()
	defer fake.getCUDAEnvironmentMutex.RUnlock()
	argsForCall := fake.getCUDAEnvironmentArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironmentReturns(result1 map[string]string) {
	fake.getCUDAEnvironmentMutex.Lock()
	defer fake.getCUDAEnvironmentMutex.Unlock()
	fake.GetCUDAEnvironmentStub = nil
	fake.getCUDAEnvironmentReturns = struct {
		result1 map[string]string
	}{result1}
}

func (fake *FakeEnvironmentManager) GetCUDAEnvironmentReturnsOnCall(i int, result1 map[string]string) {
	fake.getCUDAEnvironmentMutex.Lock()
	defer fake.getCUDAEnvironmentMutex.Unlock()
	fake.GetCUDAEnvironmentStub = nil
	if fake.getCUDAEnvironmentReturnsOnCall == nil {
		fake.getCUDAEnvironmentReturnsOnCall = make(map[int]struct {
			result1 map[string]string
		})
	}
	fake.getCUDAEnvironmentReturnsOnCall[i] = struct {
		result1 map[string]string
	}{result1}
}

func (fake *FakeEnvironmentManager) PrepareWorkspace(arg1 string, arg2 []domain.FileUpload) (string, error) {
	var arg2Copy []domain.FileUpload
	if arg2 != nil {
		arg2Copy = make([]domain.FileUpload, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.prepareWorkspaceMutex.Lock()
	ret, specificReturn := fake.prepareWorkspaceReturnsOnCall[len(fake.prepareWorkspaceArgsForCall)]
	fake.prepareWorkspaceArgsForCall = append(fake.prepareWorkspaceArgsForCall, struct {
		arg1 string
		arg2 []domain.FileUpload
	}{arg1, arg2Copy})
	stub := fake.PrepareWorkspaceStub
	fakeReturns := fake.prepareWorkspaceReturns
	fake.recordInvocation("PrepareWorkspace", []interface{}{arg1, arg2Copy})
	fake.prepareWorkspaceMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeEnvironmentManager) PrepareWorkspaceCallCount() int {
	fake.prepareWorkspaceMutex.RLock()
	defer fake.prepareWorkspaceMutex.RUnlock()
	return len(fake.prepareWorkspaceArgsForCall)
}

func (fake *FakeEnvironmentManager) PrepareWorkspaceCalls(stub func(string, []domain.FileUpload) (string, error)) {
	fake.prepareWorkspaceMutex.Lock()
	defer fake.prepareWorkspaceMutex.Unlock()
	fake.PrepareWorkspaceStub = stub
}

func (fake *FakeEnvironmentManager) PrepareWorkspaceArgsForCall(i int) (string, []domain.FileUpload) {
	fake.prepareWorkspaceMutex.RLock()
	defer fake.prepareWorkspaceMutex.RUnlock()
	argsForCall := fake.prepareWorkspaceArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeEnvironmentManager) PrepareWorkspaceReturns(result1 string, result2 error) {
	fake.prepareWorkspaceMutex.Lock()
	defer fake.prepareWorkspaceMutex.Unlock()
	fake.PrepareWorkspaceStub = nil
	fake.prepareWorkspaceReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeEnvironmentManager) PrepareWorkspaceReturnsOnCall(i int, result1 string, result2 error) {
	fake.prepareWorkspaceMutex.Lock()
	defer fake.prepareWorkspaceMutex.Unlock()
	fake.PrepareWorkspaceStub = nil
	if fake.prepareWorkspaceReturnsOnCall == nil {
		fake.prepareWorkspaceReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.prepareWorkspaceReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

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

func (fake *FakeEnvironmentManager) 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 _ execution.EnvironmentManager = new(FakeEnvironmentManager)
