api/apifakes/fake_document.go (90 lines of code) (raw):
// Code generated by counterfeiter. DO NOT EDIT.
package apifakes
import (
"sync"
"k8s.io/enhancements/api"
)
type FakeDocument struct {
ValidateStub func() error
validateMutex sync.RWMutex
validateArgsForCall []struct {
}
validateReturns struct {
result1 error
}
validateReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeDocument) Validate() error {
fake.validateMutex.Lock()
ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)]
fake.validateArgsForCall = append(fake.validateArgsForCall, struct {
}{})
stub := fake.ValidateStub
fakeReturns := fake.validateReturns
fake.recordInvocation("Validate", []interface{}{})
fake.validateMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeDocument) ValidateCallCount() int {
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
return len(fake.validateArgsForCall)
}
func (fake *FakeDocument) ValidateCalls(stub func() error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = stub
}
func (fake *FakeDocument) ValidateReturns(result1 error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = nil
fake.validateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeDocument) ValidateReturnsOnCall(i int, result1 error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = nil
if fake.validateReturnsOnCall == nil {
fake.validateReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.validateReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeDocument) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeDocument) 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 _ api.Document = new(FakeDocument)