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

import (
	"lib/datastore"
	"sync"
)

type Dstore struct {
	ReadAllStub        func() (map[string]datastore.Container, error)
	readAllMutex       sync.RWMutex
	readAllArgsForCall []struct{}
	readAllReturns     struct {
		result1 map[string]datastore.Container
		result2 error
	}
	readAllReturnsOnCall map[int]struct {
		result1 map[string]datastore.Container
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *Dstore) ReadAll() (map[string]datastore.Container, error) {
	fake.readAllMutex.Lock()
	ret, specificReturn := fake.readAllReturnsOnCall[len(fake.readAllArgsForCall)]
	fake.readAllArgsForCall = append(fake.readAllArgsForCall, struct{}{})
	fake.recordInvocation("ReadAll", []interface{}{})
	fake.readAllMutex.Unlock()
	if fake.ReadAllStub != nil {
		return fake.ReadAllStub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.readAllReturns.result1, fake.readAllReturns.result2
}

func (fake *Dstore) ReadAllCallCount() int {
	fake.readAllMutex.RLock()
	defer fake.readAllMutex.RUnlock()
	return len(fake.readAllArgsForCall)
}

func (fake *Dstore) ReadAllReturns(result1 map[string]datastore.Container, result2 error) {
	fake.ReadAllStub = nil
	fake.readAllReturns = struct {
		result1 map[string]datastore.Container
		result2 error
	}{result1, result2}
}

func (fake *Dstore) ReadAllReturnsOnCall(i int, result1 map[string]datastore.Container, result2 error) {
	fake.ReadAllStub = nil
	if fake.readAllReturnsOnCall == nil {
		fake.readAllReturnsOnCall = make(map[int]struct {
			result1 map[string]datastore.Container
			result2 error
		})
	}
	fake.readAllReturnsOnCall[i] = struct {
		result1 map[string]datastore.Container
		result2 error
	}{result1, result2}
}

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

func (fake *Dstore) 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)
}
