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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/api/appfiles"
)

type FakeRepository struct {
	ListFilesStub        func(string, int, string) (string, error)
	listFilesMutex       sync.RWMutex
	listFilesArgsForCall []struct {
		arg1 string
		arg2 int
		arg3 string
	}
	listFilesReturns struct {
		result1 string
		result2 error
	}
	listFilesReturnsOnCall map[int]struct {
		result1 string
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeRepository) ListFiles(arg1 string, arg2 int, arg3 string) (string, error) {
	fake.listFilesMutex.Lock()
	ret, specificReturn := fake.listFilesReturnsOnCall[len(fake.listFilesArgsForCall)]
	fake.listFilesArgsForCall = append(fake.listFilesArgsForCall, struct {
		arg1 string
		arg2 int
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("ListFiles", []interface{}{arg1, arg2, arg3})
	fake.listFilesMutex.Unlock()
	if fake.ListFilesStub != nil {
		return fake.ListFilesStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.listFilesReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeRepository) ListFilesCallCount() int {
	fake.listFilesMutex.RLock()
	defer fake.listFilesMutex.RUnlock()
	return len(fake.listFilesArgsForCall)
}

func (fake *FakeRepository) ListFilesCalls(stub func(string, int, string) (string, error)) {
	fake.listFilesMutex.Lock()
	defer fake.listFilesMutex.Unlock()
	fake.ListFilesStub = stub
}

func (fake *FakeRepository) ListFilesArgsForCall(i int) (string, int, string) {
	fake.listFilesMutex.RLock()
	defer fake.listFilesMutex.RUnlock()
	argsForCall := fake.listFilesArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeRepository) ListFilesReturns(result1 string, result2 error) {
	fake.listFilesMutex.Lock()
	defer fake.listFilesMutex.Unlock()
	fake.ListFilesStub = nil
	fake.listFilesReturns = struct {
		result1 string
		result2 error
	}{result1, result2}
}

func (fake *FakeRepository) ListFilesReturnsOnCall(i int, result1 string, result2 error) {
	fake.listFilesMutex.Lock()
	defer fake.listFilesMutex.Unlock()
	fake.ListFilesStub = nil
	if fake.listFilesReturnsOnCall == nil {
		fake.listFilesReturnsOnCall = make(map[int]struct {
			result1 string
			result2 error
		})
	}
	fake.listFilesReturnsOnCall[i] = struct {
		result1 string
		result2 error
	}{result1, result2}
}

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

func (fake *FakeRepository) 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 _ appfiles.Repository = new(FakeRepository)
