// This file was generated by counterfeiter
package clockfakes

import (
	"sync"
	"time"

	"quota-enforcer/clock"
)

type FakeClock struct {
	AfterStub        func(time.Duration) <-chan time.Time
	afterMutex       sync.RWMutex
	afterArgsForCall []struct {
		arg1 time.Duration
	}
	afterReturns struct {
		result1 <-chan time.Time
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeClock) After(arg1 time.Duration) <-chan time.Time {
	fake.afterMutex.Lock()
	fake.afterArgsForCall = append(fake.afterArgsForCall, struct {
		arg1 time.Duration
	}{arg1})
	fake.recordInvocation("After", []interface{}{arg1})
	fake.afterMutex.Unlock()
	if fake.AfterStub != nil {
		return fake.AfterStub(arg1)
	} else {
		return fake.afterReturns.result1
	}
}

func (fake *FakeClock) AfterCallCount() int {
	fake.afterMutex.RLock()
	defer fake.afterMutex.RUnlock()
	return len(fake.afterArgsForCall)
}

func (fake *FakeClock) AfterArgsForCall(i int) time.Duration {
	fake.afterMutex.RLock()
	defer fake.afterMutex.RUnlock()
	return fake.afterArgsForCall[i].arg1
}

func (fake *FakeClock) AfterReturns(result1 <-chan time.Time) {
	fake.AfterStub = nil
	fake.afterReturns = struct {
		result1 <-chan time.Time
	}{result1}
}

func (fake *FakeClock) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.afterMutex.RLock()
	defer fake.afterMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeClock) 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 _ clock.Clock = new(FakeClock)
