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

import (
	"sync"

	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/models"
	"code.cloudfoundry.org/app-autoscaler/src/autoscaler/scalingengine"
)

type FakeScalingEngine struct {
	ComputeNewInstancesStub        func(int, string) (int, error)
	computeNewInstancesMutex       sync.RWMutex
	computeNewInstancesArgsForCall []struct {
		arg1 int
		arg2 string
	}
	computeNewInstancesReturns struct {
		result1 int
		result2 error
	}
	computeNewInstancesReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	RemoveActiveScheduleStub        func(string, string) error
	removeActiveScheduleMutex       sync.RWMutex
	removeActiveScheduleArgsForCall []struct {
		arg1 string
		arg2 string
	}
	removeActiveScheduleReturns struct {
		result1 error
	}
	removeActiveScheduleReturnsOnCall map[int]struct {
		result1 error
	}
	ScaleStub        func(string, *models.Trigger) (*models.AppScalingResult, error)
	scaleMutex       sync.RWMutex
	scaleArgsForCall []struct {
		arg1 string
		arg2 *models.Trigger
	}
	scaleReturns struct {
		result1 *models.AppScalingResult
		result2 error
	}
	scaleReturnsOnCall map[int]struct {
		result1 *models.AppScalingResult
		result2 error
	}
	SetActiveScheduleStub        func(string, *models.ActiveSchedule) error
	setActiveScheduleMutex       sync.RWMutex
	setActiveScheduleArgsForCall []struct {
		arg1 string
		arg2 *models.ActiveSchedule
	}
	setActiveScheduleReturns struct {
		result1 error
	}
	setActiveScheduleReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeScalingEngine) ComputeNewInstances(arg1 int, arg2 string) (int, error) {
	fake.computeNewInstancesMutex.Lock()
	ret, specificReturn := fake.computeNewInstancesReturnsOnCall[len(fake.computeNewInstancesArgsForCall)]
	fake.computeNewInstancesArgsForCall = append(fake.computeNewInstancesArgsForCall, struct {
		arg1 int
		arg2 string
	}{arg1, arg2})
	stub := fake.ComputeNewInstancesStub
	fakeReturns := fake.computeNewInstancesReturns
	fake.recordInvocation("ComputeNewInstances", []interface{}{arg1, arg2})
	fake.computeNewInstancesMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeScalingEngine) ComputeNewInstancesCallCount() int {
	fake.computeNewInstancesMutex.RLock()
	defer fake.computeNewInstancesMutex.RUnlock()
	return len(fake.computeNewInstancesArgsForCall)
}

func (fake *FakeScalingEngine) ComputeNewInstancesCalls(stub func(int, string) (int, error)) {
	fake.computeNewInstancesMutex.Lock()
	defer fake.computeNewInstancesMutex.Unlock()
	fake.ComputeNewInstancesStub = stub
}

func (fake *FakeScalingEngine) ComputeNewInstancesArgsForCall(i int) (int, string) {
	fake.computeNewInstancesMutex.RLock()
	defer fake.computeNewInstancesMutex.RUnlock()
	argsForCall := fake.computeNewInstancesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngine) ComputeNewInstancesReturns(result1 int, result2 error) {
	fake.computeNewInstancesMutex.Lock()
	defer fake.computeNewInstancesMutex.Unlock()
	fake.ComputeNewInstancesStub = nil
	fake.computeNewInstancesReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngine) ComputeNewInstancesReturnsOnCall(i int, result1 int, result2 error) {
	fake.computeNewInstancesMutex.Lock()
	defer fake.computeNewInstancesMutex.Unlock()
	fake.ComputeNewInstancesStub = nil
	if fake.computeNewInstancesReturnsOnCall == nil {
		fake.computeNewInstancesReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.computeNewInstancesReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngine) RemoveActiveSchedule(arg1 string, arg2 string) error {
	fake.removeActiveScheduleMutex.Lock()
	ret, specificReturn := fake.removeActiveScheduleReturnsOnCall[len(fake.removeActiveScheduleArgsForCall)]
	fake.removeActiveScheduleArgsForCall = append(fake.removeActiveScheduleArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	stub := fake.RemoveActiveScheduleStub
	fakeReturns := fake.removeActiveScheduleReturns
	fake.recordInvocation("RemoveActiveSchedule", []interface{}{arg1, arg2})
	fake.removeActiveScheduleMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngine) RemoveActiveScheduleCallCount() int {
	fake.removeActiveScheduleMutex.RLock()
	defer fake.removeActiveScheduleMutex.RUnlock()
	return len(fake.removeActiveScheduleArgsForCall)
}

func (fake *FakeScalingEngine) RemoveActiveScheduleCalls(stub func(string, string) error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = stub
}

func (fake *FakeScalingEngine) RemoveActiveScheduleArgsForCall(i int) (string, string) {
	fake.removeActiveScheduleMutex.RLock()
	defer fake.removeActiveScheduleMutex.RUnlock()
	argsForCall := fake.removeActiveScheduleArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngine) RemoveActiveScheduleReturns(result1 error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = nil
	fake.removeActiveScheduleReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngine) RemoveActiveScheduleReturnsOnCall(i int, result1 error) {
	fake.removeActiveScheduleMutex.Lock()
	defer fake.removeActiveScheduleMutex.Unlock()
	fake.RemoveActiveScheduleStub = nil
	if fake.removeActiveScheduleReturnsOnCall == nil {
		fake.removeActiveScheduleReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.removeActiveScheduleReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngine) Scale(arg1 string, arg2 *models.Trigger) (*models.AppScalingResult, error) {
	fake.scaleMutex.Lock()
	ret, specificReturn := fake.scaleReturnsOnCall[len(fake.scaleArgsForCall)]
	fake.scaleArgsForCall = append(fake.scaleArgsForCall, struct {
		arg1 string
		arg2 *models.Trigger
	}{arg1, arg2})
	stub := fake.ScaleStub
	fakeReturns := fake.scaleReturns
	fake.recordInvocation("Scale", []interface{}{arg1, arg2})
	fake.scaleMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeScalingEngine) ScaleCallCount() int {
	fake.scaleMutex.RLock()
	defer fake.scaleMutex.RUnlock()
	return len(fake.scaleArgsForCall)
}

func (fake *FakeScalingEngine) ScaleCalls(stub func(string, *models.Trigger) (*models.AppScalingResult, error)) {
	fake.scaleMutex.Lock()
	defer fake.scaleMutex.Unlock()
	fake.ScaleStub = stub
}

func (fake *FakeScalingEngine) ScaleArgsForCall(i int) (string, *models.Trigger) {
	fake.scaleMutex.RLock()
	defer fake.scaleMutex.RUnlock()
	argsForCall := fake.scaleArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngine) ScaleReturns(result1 *models.AppScalingResult, result2 error) {
	fake.scaleMutex.Lock()
	defer fake.scaleMutex.Unlock()
	fake.ScaleStub = nil
	fake.scaleReturns = struct {
		result1 *models.AppScalingResult
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngine) ScaleReturnsOnCall(i int, result1 *models.AppScalingResult, result2 error) {
	fake.scaleMutex.Lock()
	defer fake.scaleMutex.Unlock()
	fake.ScaleStub = nil
	if fake.scaleReturnsOnCall == nil {
		fake.scaleReturnsOnCall = make(map[int]struct {
			result1 *models.AppScalingResult
			result2 error
		})
	}
	fake.scaleReturnsOnCall[i] = struct {
		result1 *models.AppScalingResult
		result2 error
	}{result1, result2}
}

func (fake *FakeScalingEngine) SetActiveSchedule(arg1 string, arg2 *models.ActiveSchedule) error {
	fake.setActiveScheduleMutex.Lock()
	ret, specificReturn := fake.setActiveScheduleReturnsOnCall[len(fake.setActiveScheduleArgsForCall)]
	fake.setActiveScheduleArgsForCall = append(fake.setActiveScheduleArgsForCall, struct {
		arg1 string
		arg2 *models.ActiveSchedule
	}{arg1, arg2})
	stub := fake.SetActiveScheduleStub
	fakeReturns := fake.setActiveScheduleReturns
	fake.recordInvocation("SetActiveSchedule", []interface{}{arg1, arg2})
	fake.setActiveScheduleMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeScalingEngine) SetActiveScheduleCallCount() int {
	fake.setActiveScheduleMutex.RLock()
	defer fake.setActiveScheduleMutex.RUnlock()
	return len(fake.setActiveScheduleArgsForCall)
}

func (fake *FakeScalingEngine) SetActiveScheduleCalls(stub func(string, *models.ActiveSchedule) error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = stub
}

func (fake *FakeScalingEngine) SetActiveScheduleArgsForCall(i int) (string, *models.ActiveSchedule) {
	fake.setActiveScheduleMutex.RLock()
	defer fake.setActiveScheduleMutex.RUnlock()
	argsForCall := fake.setActiveScheduleArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeScalingEngine) SetActiveScheduleReturns(result1 error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = nil
	fake.setActiveScheduleReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeScalingEngine) SetActiveScheduleReturnsOnCall(i int, result1 error) {
	fake.setActiveScheduleMutex.Lock()
	defer fake.setActiveScheduleMutex.Unlock()
	fake.SetActiveScheduleStub = nil
	if fake.setActiveScheduleReturnsOnCall == nil {
		fake.setActiveScheduleReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.setActiveScheduleReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeScalingEngine) 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 _ scalingengine.ScalingEngine = new(FakeScalingEngine)
