// Copyright 2024 Matthew Rich . All rights reserved. package resource import ( "decl/internal/data" ) type MockConverter struct { InjectType func() data.TypeName InjectEmit func(document data.Document, filter data.ElementSelector) (data.Resource, error) InjectExtract func(resource data.Resource, filter data.ElementSelector) (data.Document, error) InjectExtractMany func(resource data.Resource, filter data.ElementSelector) ([]data.Document, error) InjectEmitMany func(documents []data.Document, filter data.ElementSelector) (data.Resource, error) InjectClose func() error } func (m *MockConverter) Emit(document data.Document, filter data.ElementSelector) (data.Resource, error) { return m.InjectEmit(document, filter) } func (m *MockConverter) EmitMany(documents []data.Document, filter data.ElementSelector) (data.Resource, error) { return m.InjectEmitMany(documents, filter) } func (m *MockConverter) Extract(resource data.Resource, filter data.ElementSelector) (data.Document, error) { return m.InjectExtract(resource, filter) } func (m *MockConverter) ExtractMany(resource data.Resource, filter data.ElementSelector) ([]data.Document, error) { return m.InjectExtractMany(resource, filter) } func (m *MockConverter) Type() data.TypeName { return m.InjectType() } func (m *MockConverter) Close() error { return m.InjectClose() }