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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/repositories"
)

type RepositoryCreator struct {
	CreateRepositoryStub        func(context.Context, string) error
	createRepositoryMutex       sync.RWMutex
	createRepositoryArgsForCall []struct {
		arg1 context.Context
		arg2 string
	}
	createRepositoryReturns struct {
		result1 error
	}
	createRepositoryReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *RepositoryCreator) CreateRepository(arg1 context.Context, arg2 string) error {
	fake.createRepositoryMutex.Lock()
	ret, specificReturn := fake.createRepositoryReturnsOnCall[len(fake.createRepositoryArgsForCall)]
	fake.createRepositoryArgsForCall = append(fake.createRepositoryArgsForCall, struct {
		arg1 context.Context
		arg2 string
	}{arg1, arg2})
	stub := fake.CreateRepositoryStub
	fakeReturns := fake.createRepositoryReturns
	fake.recordInvocation("CreateRepository", []interface{}{arg1, arg2})
	fake.createRepositoryMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *RepositoryCreator) CreateRepositoryCallCount() int {
	fake.createRepositoryMutex.RLock()
	defer fake.createRepositoryMutex.RUnlock()
	return len(fake.createRepositoryArgsForCall)
}

func (fake *RepositoryCreator) CreateRepositoryCalls(stub func(context.Context, string) error) {
	fake.createRepositoryMutex.Lock()
	defer fake.createRepositoryMutex.Unlock()
	fake.CreateRepositoryStub = stub
}

func (fake *RepositoryCreator) CreateRepositoryArgsForCall(i int) (context.Context, string) {
	fake.createRepositoryMutex.RLock()
	defer fake.createRepositoryMutex.RUnlock()
	argsForCall := fake.createRepositoryArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *RepositoryCreator) CreateRepositoryReturns(result1 error) {
	fake.createRepositoryMutex.Lock()
	defer fake.createRepositoryMutex.Unlock()
	fake.CreateRepositoryStub = nil
	fake.createRepositoryReturns = struct {
		result1 error
	}{result1}
}

func (fake *RepositoryCreator) CreateRepositoryReturnsOnCall(i int, result1 error) {
	fake.createRepositoryMutex.Lock()
	defer fake.createRepositoryMutex.Unlock()
	fake.CreateRepositoryStub = nil
	if fake.createRepositoryReturnsOnCall == nil {
		fake.createRepositoryReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.createRepositoryReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *RepositoryCreator) 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 *RepositoryCreator) 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 _ repositories.RepositoryCreator = new(RepositoryCreator)
