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

import (
	"sync"

	"code.cloudfoundry.org/guardian/rundmc"
)

type FakeEventStore struct {
	EventsStub        func(string) []string
	eventsMutex       sync.RWMutex
	eventsArgsForCall []struct {
		arg1 string
	}
	eventsReturns struct {
		result1 []string
	}
	eventsReturnsOnCall map[int]struct {
		result1 []string
	}
	OnEventStub        func(string, string) error
	onEventMutex       sync.RWMutex
	onEventArgsForCall []struct {
		arg1 string
		arg2 string
	}
	onEventReturns struct {
		result1 error
	}
	onEventReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeEventStore) Events(arg1 string) []string {
	fake.eventsMutex.Lock()
	ret, specificReturn := fake.eventsReturnsOnCall[len(fake.eventsArgsForCall)]
	fake.eventsArgsForCall = append(fake.eventsArgsForCall, struct {
		arg1 string
	}{arg1})
	stub := fake.EventsStub
	fakeReturns := fake.eventsReturns
	fake.recordInvocation("Events", []interface{}{arg1})
	fake.eventsMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEventStore) EventsCallCount() int {
	fake.eventsMutex.RLock()
	defer fake.eventsMutex.RUnlock()
	return len(fake.eventsArgsForCall)
}

func (fake *FakeEventStore) EventsCalls(stub func(string) []string) {
	fake.eventsMutex.Lock()
	defer fake.eventsMutex.Unlock()
	fake.EventsStub = stub
}

func (fake *FakeEventStore) EventsArgsForCall(i int) string {
	fake.eventsMutex.RLock()
	defer fake.eventsMutex.RUnlock()
	argsForCall := fake.eventsArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeEventStore) EventsReturns(result1 []string) {
	fake.eventsMutex.Lock()
	defer fake.eventsMutex.Unlock()
	fake.EventsStub = nil
	fake.eventsReturns = struct {
		result1 []string
	}{result1}
}

func (fake *FakeEventStore) EventsReturnsOnCall(i int, result1 []string) {
	fake.eventsMutex.Lock()
	defer fake.eventsMutex.Unlock()
	fake.EventsStub = nil
	if fake.eventsReturnsOnCall == nil {
		fake.eventsReturnsOnCall = make(map[int]struct {
			result1 []string
		})
	}
	fake.eventsReturnsOnCall[i] = struct {
		result1 []string
	}{result1}
}

func (fake *FakeEventStore) OnEvent(arg1 string, arg2 string) error {
	fake.onEventMutex.Lock()
	ret, specificReturn := fake.onEventReturnsOnCall[len(fake.onEventArgsForCall)]
	fake.onEventArgsForCall = append(fake.onEventArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	stub := fake.OnEventStub
	fakeReturns := fake.onEventReturns
	fake.recordInvocation("OnEvent", []interface{}{arg1, arg2})
	fake.onEventMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeEventStore) OnEventCallCount() int {
	fake.onEventMutex.RLock()
	defer fake.onEventMutex.RUnlock()
	return len(fake.onEventArgsForCall)
}

func (fake *FakeEventStore) OnEventCalls(stub func(string, string) error) {
	fake.onEventMutex.Lock()
	defer fake.onEventMutex.Unlock()
	fake.OnEventStub = stub
}

func (fake *FakeEventStore) OnEventArgsForCall(i int) (string, string) {
	fake.onEventMutex.RLock()
	defer fake.onEventMutex.RUnlock()
	argsForCall := fake.onEventArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeEventStore) OnEventReturns(result1 error) {
	fake.onEventMutex.Lock()
	defer fake.onEventMutex.Unlock()
	fake.OnEventStub = nil
	fake.onEventReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeEventStore) OnEventReturnsOnCall(i int, result1 error) {
	fake.onEventMutex.Lock()
	defer fake.onEventMutex.Unlock()
	fake.OnEventStub = nil
	if fake.onEventReturnsOnCall == nil {
		fake.onEventReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.onEventReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *FakeEventStore) 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 _ rundmc.EventStore = new(FakeEventStore)
