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

import (
	"os"
	"sync"

	"code.cloudfoundry.org/auction/auctiontypes"
	"code.cloudfoundry.org/auctioneer"
)

type FakeAuctionRunner struct {
	RunStub        func(<-chan os.Signal, chan<- struct{}) error
	runMutex       sync.RWMutex
	runArgsForCall []struct {
		arg1 <-chan os.Signal
		arg2 chan<- struct{}
	}
	runReturns struct {
		result1 error
	}
	runReturnsOnCall map[int]struct {
		result1 error
	}
	ScheduleLRPsForAuctionsStub        func([]auctioneer.LRPStartRequest, string)
	scheduleLRPsForAuctionsMutex       sync.RWMutex
	scheduleLRPsForAuctionsArgsForCall []struct {
		arg1 []auctioneer.LRPStartRequest
		arg2 string
	}
	ScheduleTasksForAuctionsStub        func([]auctioneer.TaskStartRequest, string)
	scheduleTasksForAuctionsMutex       sync.RWMutex
	scheduleTasksForAuctionsArgsForCall []struct {
		arg1 []auctioneer.TaskStartRequest
		arg2 string
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeAuctionRunner) Run(arg1 <-chan os.Signal, arg2 chan<- struct{}) error {
	fake.runMutex.Lock()
	ret, specificReturn := fake.runReturnsOnCall[len(fake.runArgsForCall)]
	fake.runArgsForCall = append(fake.runArgsForCall, struct {
		arg1 <-chan os.Signal
		arg2 chan<- struct{}
	}{arg1, arg2})
	stub := fake.RunStub
	fakeReturns := fake.runReturns
	fake.recordInvocation("Run", []interface{}{arg1, arg2})
	fake.runMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeAuctionRunner) RunCallCount() int {
	fake.runMutex.RLock()
	defer fake.runMutex.RUnlock()
	return len(fake.runArgsForCall)
}

func (fake *FakeAuctionRunner) RunCalls(stub func(<-chan os.Signal, chan<- struct{}) error) {
	fake.runMutex.Lock()
	defer fake.runMutex.Unlock()
	fake.RunStub = stub
}

func (fake *FakeAuctionRunner) RunArgsForCall(i int) (<-chan os.Signal, chan<- struct{}) {
	fake.runMutex.RLock()
	defer fake.runMutex.RUnlock()
	argsForCall := fake.runArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeAuctionRunner) RunReturns(result1 error) {
	fake.runMutex.Lock()
	defer fake.runMutex.Unlock()
	fake.RunStub = nil
	fake.runReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeAuctionRunner) RunReturnsOnCall(i int, result1 error) {
	fake.runMutex.Lock()
	defer fake.runMutex.Unlock()
	fake.RunStub = nil
	if fake.runReturnsOnCall == nil {
		fake.runReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.runReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeAuctionRunner) ScheduleLRPsForAuctions(arg1 []auctioneer.LRPStartRequest, arg2 string) {
	var arg1Copy []auctioneer.LRPStartRequest
	if arg1 != nil {
		arg1Copy = make([]auctioneer.LRPStartRequest, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.scheduleLRPsForAuctionsMutex.Lock()
	fake.scheduleLRPsForAuctionsArgsForCall = append(fake.scheduleLRPsForAuctionsArgsForCall, struct {
		arg1 []auctioneer.LRPStartRequest
		arg2 string
	}{arg1Copy, arg2})
	stub := fake.ScheduleLRPsForAuctionsStub
	fake.recordInvocation("ScheduleLRPsForAuctions", []interface{}{arg1Copy, arg2})
	fake.scheduleLRPsForAuctionsMutex.Unlock()
	if stub != nil {
		fake.ScheduleLRPsForAuctionsStub(arg1, arg2)
	}
}

func (fake *FakeAuctionRunner) ScheduleLRPsForAuctionsCallCount() int {
	fake.scheduleLRPsForAuctionsMutex.RLock()
	defer fake.scheduleLRPsForAuctionsMutex.RUnlock()
	return len(fake.scheduleLRPsForAuctionsArgsForCall)
}

func (fake *FakeAuctionRunner) ScheduleLRPsForAuctionsCalls(stub func([]auctioneer.LRPStartRequest, string)) {
	fake.scheduleLRPsForAuctionsMutex.Lock()
	defer fake.scheduleLRPsForAuctionsMutex.Unlock()
	fake.ScheduleLRPsForAuctionsStub = stub
}

func (fake *FakeAuctionRunner) ScheduleLRPsForAuctionsArgsForCall(i int) ([]auctioneer.LRPStartRequest, string) {
	fake.scheduleLRPsForAuctionsMutex.RLock()
	defer fake.scheduleLRPsForAuctionsMutex.RUnlock()
	argsForCall := fake.scheduleLRPsForAuctionsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeAuctionRunner) ScheduleTasksForAuctions(arg1 []auctioneer.TaskStartRequest, arg2 string) {
	var arg1Copy []auctioneer.TaskStartRequest
	if arg1 != nil {
		arg1Copy = make([]auctioneer.TaskStartRequest, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.scheduleTasksForAuctionsMutex.Lock()
	fake.scheduleTasksForAuctionsArgsForCall = append(fake.scheduleTasksForAuctionsArgsForCall, struct {
		arg1 []auctioneer.TaskStartRequest
		arg2 string
	}{arg1Copy, arg2})
	stub := fake.ScheduleTasksForAuctionsStub
	fake.recordInvocation("ScheduleTasksForAuctions", []interface{}{arg1Copy, arg2})
	fake.scheduleTasksForAuctionsMutex.Unlock()
	if stub != nil {
		fake.ScheduleTasksForAuctionsStub(arg1, arg2)
	}
}

func (fake *FakeAuctionRunner) ScheduleTasksForAuctionsCallCount() int {
	fake.scheduleTasksForAuctionsMutex.RLock()
	defer fake.scheduleTasksForAuctionsMutex.RUnlock()
	return len(fake.scheduleTasksForAuctionsArgsForCall)
}

func (fake *FakeAuctionRunner) ScheduleTasksForAuctionsCalls(stub func([]auctioneer.TaskStartRequest, string)) {
	fake.scheduleTasksForAuctionsMutex.Lock()
	defer fake.scheduleTasksForAuctionsMutex.Unlock()
	fake.ScheduleTasksForAuctionsStub = stub
}

func (fake *FakeAuctionRunner) ScheduleTasksForAuctionsArgsForCall(i int) ([]auctioneer.TaskStartRequest, string) {
	fake.scheduleTasksForAuctionsMutex.RLock()
	defer fake.scheduleTasksForAuctionsMutex.RUnlock()
	argsForCall := fake.scheduleTasksForAuctionsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

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

func (fake *FakeAuctionRunner) 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 _ auctiontypes.AuctionRunner = new(FakeAuctionRunner)
