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

import (
	"hash"
	"sync"
)

type FakeHash struct {
	WriteStub        func(p []byte) (n int, err error)
	writeMutex       sync.RWMutex
	writeArgsForCall []struct {
		p []byte
	}
	writeReturns struct {
		result1 int
		result2 error
	}
	writeReturnsOnCall map[int]struct {
		result1 int
		result2 error
	}
	SumStub        func(b []byte) []byte
	sumMutex       sync.RWMutex
	sumArgsForCall []struct {
		b []byte
	}
	sumReturns struct {
		result1 []byte
	}
	sumReturnsOnCall map[int]struct {
		result1 []byte
	}
	ResetStub        func()
	resetMutex       sync.RWMutex
	resetArgsForCall []struct{}
	SizeStub         func() int
	sizeMutex        sync.RWMutex
	sizeArgsForCall  []struct{}
	sizeReturns      struct {
		result1 int
	}
	sizeReturnsOnCall map[int]struct {
		result1 int
	}
	BlockSizeStub        func() int
	blockSizeMutex       sync.RWMutex
	blockSizeArgsForCall []struct{}
	blockSizeReturns     struct {
		result1 int
	}
	blockSizeReturnsOnCall map[int]struct {
		result1 int
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeHash) Write(p []byte) (n int, err error) {
	var pCopy []byte
	if p != nil {
		pCopy = make([]byte, len(p))
		copy(pCopy, p)
	}
	fake.writeMutex.Lock()
	ret, specificReturn := fake.writeReturnsOnCall[len(fake.writeArgsForCall)]
	fake.writeArgsForCall = append(fake.writeArgsForCall, struct {
		p []byte
	}{pCopy})
	fake.recordInvocation("Write", []interface{}{pCopy})
	fake.writeMutex.Unlock()
	if fake.WriteStub != nil {
		return fake.WriteStub(p)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.writeReturns.result1, fake.writeReturns.result2
}

func (fake *FakeHash) WriteCallCount() int {
	fake.writeMutex.RLock()
	defer fake.writeMutex.RUnlock()
	return len(fake.writeArgsForCall)
}

func (fake *FakeHash) WriteArgsForCall(i int) []byte {
	fake.writeMutex.RLock()
	defer fake.writeMutex.RUnlock()
	return fake.writeArgsForCall[i].p
}

func (fake *FakeHash) WriteReturns(result1 int, result2 error) {
	fake.WriteStub = nil
	fake.writeReturns = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeHash) WriteReturnsOnCall(i int, result1 int, result2 error) {
	fake.WriteStub = nil
	if fake.writeReturnsOnCall == nil {
		fake.writeReturnsOnCall = make(map[int]struct {
			result1 int
			result2 error
		})
	}
	fake.writeReturnsOnCall[i] = struct {
		result1 int
		result2 error
	}{result1, result2}
}

func (fake *FakeHash) Sum(b []byte) []byte {
	var bCopy []byte
	if b != nil {
		bCopy = make([]byte, len(b))
		copy(bCopy, b)
	}
	fake.sumMutex.Lock()
	ret, specificReturn := fake.sumReturnsOnCall[len(fake.sumArgsForCall)]
	fake.sumArgsForCall = append(fake.sumArgsForCall, struct {
		b []byte
	}{bCopy})
	fake.recordInvocation("Sum", []interface{}{bCopy})
	fake.sumMutex.Unlock()
	if fake.SumStub != nil {
		return fake.SumStub(b)
	}
	if specificReturn {
		return ret.result1
	}
	return fake.sumReturns.result1
}

func (fake *FakeHash) SumCallCount() int {
	fake.sumMutex.RLock()
	defer fake.sumMutex.RUnlock()
	return len(fake.sumArgsForCall)
}

func (fake *FakeHash) SumArgsForCall(i int) []byte {
	fake.sumMutex.RLock()
	defer fake.sumMutex.RUnlock()
	return fake.sumArgsForCall[i].b
}

func (fake *FakeHash) SumReturns(result1 []byte) {
	fake.SumStub = nil
	fake.sumReturns = struct {
		result1 []byte
	}{result1}
}

func (fake *FakeHash) SumReturnsOnCall(i int, result1 []byte) {
	fake.SumStub = nil
	if fake.sumReturnsOnCall == nil {
		fake.sumReturnsOnCall = make(map[int]struct {
			result1 []byte
		})
	}
	fake.sumReturnsOnCall[i] = struct {
		result1 []byte
	}{result1}
}

func (fake *FakeHash) Reset() {
	fake.resetMutex.Lock()
	fake.resetArgsForCall = append(fake.resetArgsForCall, struct{}{})
	fake.recordInvocation("Reset", []interface{}{})
	fake.resetMutex.Unlock()
	if fake.ResetStub != nil {
		fake.ResetStub()
	}
}

func (fake *FakeHash) ResetCallCount() int {
	fake.resetMutex.RLock()
	defer fake.resetMutex.RUnlock()
	return len(fake.resetArgsForCall)
}

func (fake *FakeHash) Size() int {
	fake.sizeMutex.Lock()
	ret, specificReturn := fake.sizeReturnsOnCall[len(fake.sizeArgsForCall)]
	fake.sizeArgsForCall = append(fake.sizeArgsForCall, struct{}{})
	fake.recordInvocation("Size", []interface{}{})
	fake.sizeMutex.Unlock()
	if fake.SizeStub != nil {
		return fake.SizeStub()
	}
	if specificReturn {
		return ret.result1
	}
	return fake.sizeReturns.result1
}

func (fake *FakeHash) SizeCallCount() int {
	fake.sizeMutex.RLock()
	defer fake.sizeMutex.RUnlock()
	return len(fake.sizeArgsForCall)
}

func (fake *FakeHash) SizeReturns(result1 int) {
	fake.SizeStub = nil
	fake.sizeReturns = struct {
		result1 int
	}{result1}
}

func (fake *FakeHash) SizeReturnsOnCall(i int, result1 int) {
	fake.SizeStub = nil
	if fake.sizeReturnsOnCall == nil {
		fake.sizeReturnsOnCall = make(map[int]struct {
			result1 int
		})
	}
	fake.sizeReturnsOnCall[i] = struct {
		result1 int
	}{result1}
}

func (fake *FakeHash) BlockSize() int {
	fake.blockSizeMutex.Lock()
	ret, specificReturn := fake.blockSizeReturnsOnCall[len(fake.blockSizeArgsForCall)]
	fake.blockSizeArgsForCall = append(fake.blockSizeArgsForCall, struct{}{})
	fake.recordInvocation("BlockSize", []interface{}{})
	fake.blockSizeMutex.Unlock()
	if fake.BlockSizeStub != nil {
		return fake.BlockSizeStub()
	}
	if specificReturn {
		return ret.result1
	}
	return fake.blockSizeReturns.result1
}

func (fake *FakeHash) BlockSizeCallCount() int {
	fake.blockSizeMutex.RLock()
	defer fake.blockSizeMutex.RUnlock()
	return len(fake.blockSizeArgsForCall)
}

func (fake *FakeHash) BlockSizeReturns(result1 int) {
	fake.BlockSizeStub = nil
	fake.blockSizeReturns = struct {
		result1 int
	}{result1}
}

func (fake *FakeHash) BlockSizeReturnsOnCall(i int, result1 int) {
	fake.BlockSizeStub = nil
	if fake.blockSizeReturnsOnCall == nil {
		fake.blockSizeReturnsOnCall = make(map[int]struct {
			result1 int
		})
	}
	fake.blockSizeReturnsOnCall[i] = struct {
		result1 int
	}{result1}
}

func (fake *FakeHash) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.writeMutex.RLock()
	defer fake.writeMutex.RUnlock()
	fake.sumMutex.RLock()
	defer fake.sumMutex.RUnlock()
	fake.resetMutex.RLock()
	defer fake.resetMutex.RUnlock()
	fake.sizeMutex.RLock()
	defer fake.sizeMutex.RUnlock()
	fake.blockSizeMutex.RLock()
	defer fake.blockSizeMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeHash) 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 _ hash.Hash = new(FakeHash)
