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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api/stacks"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeStackRepository struct {
	FindAllStub        func() ([]models.Stack, error)
	findAllMutex       sync.RWMutex
	findAllArgsForCall []struct {
	}
	findAllReturns struct {
		result1 []models.Stack
		result2 error
	}
	findAllReturnsOnCall map[int]struct {
		result1 []models.Stack
		result2 error
	}
	FindByGUIDStub        func(string) (models.Stack, error)
	findByGUIDMutex       sync.RWMutex
	findByGUIDArgsForCall []struct {
		arg1 string
	}
	findByGUIDReturns struct {
		result1 models.Stack
		result2 error
	}
	findByGUIDReturnsOnCall map[int]struct {
		result1 models.Stack
		result2 error
	}
	FindByNameStub        func(string) (models.Stack, error)
	findByNameMutex       sync.RWMutex
	findByNameArgsForCall []struct {
		arg1 string
	}
	findByNameReturns struct {
		result1 models.Stack
		result2 error
	}
	findByNameReturnsOnCall map[int]struct {
		result1 models.Stack
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeStackRepository) FindAll() ([]models.Stack, error) {
	fake.findAllMutex.Lock()
	ret, specificReturn := fake.findAllReturnsOnCall[len(fake.findAllArgsForCall)]
	fake.findAllArgsForCall = append(fake.findAllArgsForCall, struct {
	}{})
	fake.recordInvocation("FindAll", []interface{}{})
	fake.findAllMutex.Unlock()
	if fake.FindAllStub != nil {
		return fake.FindAllStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findAllReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeStackRepository) FindAllCallCount() int {
	fake.findAllMutex.RLock()
	defer fake.findAllMutex.RUnlock()
	return len(fake.findAllArgsForCall)
}

func (fake *FakeStackRepository) FindAllCalls(stub func() ([]models.Stack, error)) {
	fake.findAllMutex.Lock()
	defer fake.findAllMutex.Unlock()
	fake.FindAllStub = stub
}

func (fake *FakeStackRepository) FindAllReturns(result1 []models.Stack, result2 error) {
	fake.findAllMutex.Lock()
	defer fake.findAllMutex.Unlock()
	fake.FindAllStub = nil
	fake.findAllReturns = struct {
		result1 []models.Stack
		result2 error
	}{result1, result2}
}

func (fake *FakeStackRepository) FindAllReturnsOnCall(i int, result1 []models.Stack, result2 error) {
	fake.findAllMutex.Lock()
	defer fake.findAllMutex.Unlock()
	fake.FindAllStub = nil
	if fake.findAllReturnsOnCall == nil {
		fake.findAllReturnsOnCall = make(map[int]struct {
			result1 []models.Stack
			result2 error
		})
	}
	fake.findAllReturnsOnCall[i] = struct {
		result1 []models.Stack
		result2 error
	}{result1, result2}
}

func (fake *FakeStackRepository) FindByGUID(arg1 string) (models.Stack, error) {
	fake.findByGUIDMutex.Lock()
	ret, specificReturn := fake.findByGUIDReturnsOnCall[len(fake.findByGUIDArgsForCall)]
	fake.findByGUIDArgsForCall = append(fake.findByGUIDArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("FindByGUID", []interface{}{arg1})
	fake.findByGUIDMutex.Unlock()
	if fake.FindByGUIDStub != nil {
		return fake.FindByGUIDStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByGUIDReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeStackRepository) FindByGUIDCallCount() int {
	fake.findByGUIDMutex.RLock()
	defer fake.findByGUIDMutex.RUnlock()
	return len(fake.findByGUIDArgsForCall)
}

func (fake *FakeStackRepository) FindByGUIDCalls(stub func(string) (models.Stack, error)) {
	fake.findByGUIDMutex.Lock()
	defer fake.findByGUIDMutex.Unlock()
	fake.FindByGUIDStub = stub
}

func (fake *FakeStackRepository) FindByGUIDArgsForCall(i int) string {
	fake.findByGUIDMutex.RLock()
	defer fake.findByGUIDMutex.RUnlock()
	argsForCall := fake.findByGUIDArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStackRepository) FindByGUIDReturns(result1 models.Stack, result2 error) {
	fake.findByGUIDMutex.Lock()
	defer fake.findByGUIDMutex.Unlock()
	fake.FindByGUIDStub = nil
	fake.findByGUIDReturns = struct {
		result1 models.Stack
		result2 error
	}{result1, result2}
}

func (fake *FakeStackRepository) FindByGUIDReturnsOnCall(i int, result1 models.Stack, result2 error) {
	fake.findByGUIDMutex.Lock()
	defer fake.findByGUIDMutex.Unlock()
	fake.FindByGUIDStub = nil
	if fake.findByGUIDReturnsOnCall == nil {
		fake.findByGUIDReturnsOnCall = make(map[int]struct {
			result1 models.Stack
			result2 error
		})
	}
	fake.findByGUIDReturnsOnCall[i] = struct {
		result1 models.Stack
		result2 error
	}{result1, result2}
}

func (fake *FakeStackRepository) FindByName(arg1 string) (models.Stack, error) {
	fake.findByNameMutex.Lock()
	ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)]
	fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("FindByName", []interface{}{arg1})
	fake.findByNameMutex.Unlock()
	if fake.FindByNameStub != nil {
		return fake.FindByNameStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.findByNameReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeStackRepository) FindByNameCallCount() int {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	return len(fake.findByNameArgsForCall)
}

func (fake *FakeStackRepository) FindByNameCalls(stub func(string) (models.Stack, error)) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = stub
}

func (fake *FakeStackRepository) FindByNameArgsForCall(i int) string {
	fake.findByNameMutex.RLock()
	defer fake.findByNameMutex.RUnlock()
	argsForCall := fake.findByNameArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeStackRepository) FindByNameReturns(result1 models.Stack, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	fake.findByNameReturns = struct {
		result1 models.Stack
		result2 error
	}{result1, result2}
}

func (fake *FakeStackRepository) FindByNameReturnsOnCall(i int, result1 models.Stack, result2 error) {
	fake.findByNameMutex.Lock()
	defer fake.findByNameMutex.Unlock()
	fake.FindByNameStub = nil
	if fake.findByNameReturnsOnCall == nil {
		fake.findByNameReturnsOnCall = make(map[int]struct {
			result1 models.Stack
			result2 error
		})
	}
	fake.findByNameReturnsOnCall[i] = struct {
		result1 models.Stack
		result2 error
	}{result1, result2}
}

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

func (fake *FakeStackRepository) 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 _ stacks.StackRepository = new(FakeStackRepository)
