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

import (
	"sync"

	"github.com/ehsaniara/joblet/pkg/platform"
)

type FakeCommandFactory struct {
	CommandContextStub        func(interface{}, string, ...string) platform.Command
	commandContextMutex       sync.RWMutex
	commandContextArgsForCall []struct {
		arg1 interface{}
		arg2 string
		arg3 []string
	}
	commandContextReturns struct {
		result1 platform.Command
	}
	commandContextReturnsOnCall map[int]struct {
		result1 platform.Command
	}
	CreateCommandStub        func(string, ...string) *platform.ExecCommand
	createCommandMutex       sync.RWMutex
	createCommandArgsForCall []struct {
		arg1 string
		arg2 []string
	}
	createCommandReturns struct {
		result1 *platform.ExecCommand
	}
	createCommandReturnsOnCall map[int]struct {
		result1 *platform.ExecCommand
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeCommandFactory) CommandContext(arg1 interface{}, arg2 string, arg3 ...string) platform.Command {
	fake.commandContextMutex.Lock()
	ret, specificReturn := fake.commandContextReturnsOnCall[len(fake.commandContextArgsForCall)]
	fake.commandContextArgsForCall = append(fake.commandContextArgsForCall, struct {
		arg1 interface{}
		arg2 string
		arg3 []string
	}{arg1, arg2, arg3})
	stub := fake.CommandContextStub
	fakeReturns := fake.commandContextReturns
	fake.recordInvocation("CommandContext", []interface{}{arg1, arg2, arg3})
	fake.commandContextMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3...)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCommandFactory) CommandContextCallCount() int {
	fake.commandContextMutex.RLock()
	defer fake.commandContextMutex.RUnlock()
	return len(fake.commandContextArgsForCall)
}

func (fake *FakeCommandFactory) CommandContextCalls(stub func(interface{}, string, ...string) platform.Command) {
	fake.commandContextMutex.Lock()
	defer fake.commandContextMutex.Unlock()
	fake.CommandContextStub = stub
}

func (fake *FakeCommandFactory) CommandContextArgsForCall(i int) (interface{}, string, []string) {
	fake.commandContextMutex.RLock()
	defer fake.commandContextMutex.RUnlock()
	argsForCall := fake.commandContextArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeCommandFactory) CommandContextReturns(result1 platform.Command) {
	fake.commandContextMutex.Lock()
	defer fake.commandContextMutex.Unlock()
	fake.CommandContextStub = nil
	fake.commandContextReturns = struct {
		result1 platform.Command
	}{result1}
}

func (fake *FakeCommandFactory) CommandContextReturnsOnCall(i int, result1 platform.Command) {
	fake.commandContextMutex.Lock()
	defer fake.commandContextMutex.Unlock()
	fake.CommandContextStub = nil
	if fake.commandContextReturnsOnCall == nil {
		fake.commandContextReturnsOnCall = make(map[int]struct {
			result1 platform.Command
		})
	}
	fake.commandContextReturnsOnCall[i] = struct {
		result1 platform.Command
	}{result1}
}

func (fake *FakeCommandFactory) CreateCommand(arg1 string, arg2 ...string) *platform.ExecCommand {
	fake.createCommandMutex.Lock()
	ret, specificReturn := fake.createCommandReturnsOnCall[len(fake.createCommandArgsForCall)]
	fake.createCommandArgsForCall = append(fake.createCommandArgsForCall, struct {
		arg1 string
		arg2 []string
	}{arg1, arg2})
	stub := fake.CreateCommandStub
	fakeReturns := fake.createCommandReturns
	fake.recordInvocation("CreateCommand", []interface{}{arg1, arg2})
	fake.createCommandMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2...)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCommandFactory) CreateCommandCallCount() int {
	fake.createCommandMutex.RLock()
	defer fake.createCommandMutex.RUnlock()
	return len(fake.createCommandArgsForCall)
}

func (fake *FakeCommandFactory) CreateCommandCalls(stub func(string, ...string) *platform.ExecCommand) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = stub
}

func (fake *FakeCommandFactory) CreateCommandArgsForCall(i int) (string, []string) {
	fake.createCommandMutex.RLock()
	defer fake.createCommandMutex.RUnlock()
	argsForCall := fake.createCommandArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCommandFactory) CreateCommandReturns(result1 *platform.ExecCommand) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = nil
	fake.createCommandReturns = struct {
		result1 *platform.ExecCommand
	}{result1}
}

func (fake *FakeCommandFactory) CreateCommandReturnsOnCall(i int, result1 *platform.ExecCommand) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = nil
	if fake.createCommandReturnsOnCall == nil {
		fake.createCommandReturnsOnCall = make(map[int]struct {
			result1 *platform.ExecCommand
		})
	}
	fake.createCommandReturnsOnCall[i] = struct {
		result1 *platform.ExecCommand
	}{result1}
}

func (fake *FakeCommandFactory) 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 *FakeCommandFactory) 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 _ platform.CommandFactory = new(FakeCommandFactory)
