querytest

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package querytest provides test helpers for query options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptMatcherFunc

func OptMatcherFunc(want ...query.Option) func([]query.Option) bool

OptMatcherFunc returns a matcher function that validates if the got query options produce the same Query state as the want options.

Types

type Cursor

type Cursor struct {
	mock.Mock
}

Cursor is an autogenerated mock type for the Cursor type

func NewCursor

func NewCursor(t interface {
	mock.TestingT
	Cleanup(func())
}) *Cursor

NewCursor creates a new instance of Cursor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Cursor) CreatedAt

func (_mock *Cursor) CreatedAt() time.Time

CreatedAt provides a mock function for the type Cursor

func (*Cursor) EXPECT

func (_m *Cursor) EXPECT() *Cursor_Expecter

func (*Cursor) Limit

func (_mock *Cursor) Limit() int

Limit provides a mock function for the type Cursor

func (*Cursor) UUID

func (_mock *Cursor) UUID() string

UUID provides a mock function for the type Cursor

type Cursor_CreatedAt_Call

type Cursor_CreatedAt_Call struct {
	*mock.Call
}

Cursor_CreatedAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatedAt'

func (*Cursor_CreatedAt_Call) Return

func (*Cursor_CreatedAt_Call) Run

func (_c *Cursor_CreatedAt_Call) Run(run func()) *Cursor_CreatedAt_Call

func (*Cursor_CreatedAt_Call) RunAndReturn

func (_c *Cursor_CreatedAt_Call) RunAndReturn(run func() time.Time) *Cursor_CreatedAt_Call

type Cursor_Expecter

type Cursor_Expecter struct {
	// contains filtered or unexported fields
}

func (*Cursor_Expecter) CreatedAt

func (_e *Cursor_Expecter) CreatedAt() *Cursor_CreatedAt_Call

CreatedAt is a helper method to define mock.On call

func (*Cursor_Expecter) Limit

func (_e *Cursor_Expecter) Limit() *Cursor_Limit_Call

Limit is a helper method to define mock.On call

func (*Cursor_Expecter) UUID

func (_e *Cursor_Expecter) UUID() *Cursor_UUID_Call

UUID is a helper method to define mock.On call

type Cursor_Limit_Call

type Cursor_Limit_Call struct {
	*mock.Call
}

Cursor_Limit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limit'

func (*Cursor_Limit_Call) Return

func (_c *Cursor_Limit_Call) Return(n int) *Cursor_Limit_Call

func (*Cursor_Limit_Call) Run

func (_c *Cursor_Limit_Call) Run(run func()) *Cursor_Limit_Call

func (*Cursor_Limit_Call) RunAndReturn

func (_c *Cursor_Limit_Call) RunAndReturn(run func() int) *Cursor_Limit_Call

type Cursor_UUID_Call

type Cursor_UUID_Call struct {
	*mock.Call
}

Cursor_UUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UUID'

func (*Cursor_UUID_Call) Return

func (_c *Cursor_UUID_Call) Return(s string) *Cursor_UUID_Call

func (*Cursor_UUID_Call) Run

func (_c *Cursor_UUID_Call) Run(run func()) *Cursor_UUID_Call

func (*Cursor_UUID_Call) RunAndReturn

func (_c *Cursor_UUID_Call) RunAndReturn(run func() string) *Cursor_UUID_Call

type Query

type Query struct {
	mock.Mock
}

Query is an autogenerated mock type for the Query type

func NewQuery

func NewQuery(t interface {
	mock.TestingT
	Cleanup(func())
}) *Query

NewQuery creates a new instance of Query. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Query) EXPECT

func (_m *Query) EXPECT() *Query_Expecter

func (*Query) Equal

func (_mock *Query) Equal(another query.Query) bool

Equal provides a mock function for the type Query

func (*Query) Filters

func (_mock *Query) Filters() query.Filters[any]

Filters provides a mock function for the type Query

func (*Query) IncludedResourceObjects

func (_mock *Query) IncludedResourceObjects() []string

IncludedResourceObjects provides a mock function for the type Query

func (*Query) Merge

func (_mock *Query) Merge(q query.Query)

Merge provides a mock function for the type Query

func (*Query) Pagination

func (_mock *Query) Pagination() *query.PaginationParams

Pagination provides a mock function for the type Query

func (*Query) Sorting

func (_mock *Query) Sorting() *query.SortingParams

Sorting provides a mock function for the type Query

type Query_Equal_Call

type Query_Equal_Call struct {
	*mock.Call
}

Query_Equal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equal'

func (*Query_Equal_Call) Return

func (_c *Query_Equal_Call) Return(b bool) *Query_Equal_Call

func (*Query_Equal_Call) Run

func (_c *Query_Equal_Call) Run(run func(another query.Query)) *Query_Equal_Call

func (*Query_Equal_Call) RunAndReturn

func (_c *Query_Equal_Call) RunAndReturn(run func(another query.Query) bool) *Query_Equal_Call

type Query_Expecter

type Query_Expecter struct {
	// contains filtered or unexported fields
}

func (*Query_Expecter) Equal

func (_e *Query_Expecter) Equal(another interface{}) *Query_Equal_Call

Equal is a helper method to define mock.On call

  • another query.Query

func (*Query_Expecter) Filters

func (_e *Query_Expecter) Filters() *Query_Filters_Call

Filters is a helper method to define mock.On call

func (*Query_Expecter) IncludedResourceObjects

func (_e *Query_Expecter) IncludedResourceObjects() *Query_IncludedResourceObjects_Call

IncludedResourceObjects is a helper method to define mock.On call

func (*Query_Expecter) Merge

func (_e *Query_Expecter) Merge(q interface{}) *Query_Merge_Call

Merge is a helper method to define mock.On call

  • q query.Query

func (*Query_Expecter) Pagination

func (_e *Query_Expecter) Pagination() *Query_Pagination_Call

Pagination is a helper method to define mock.On call

func (*Query_Expecter) Sorting

func (_e *Query_Expecter) Sorting() *Query_Sorting_Call

Sorting is a helper method to define mock.On call

type Query_Filters_Call

type Query_Filters_Call struct {
	*mock.Call
}

Query_Filters_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Filters'

func (*Query_Filters_Call) Return

func (_c *Query_Filters_Call) Return(filters query.Filters[any]) *Query_Filters_Call

func (*Query_Filters_Call) Run

func (_c *Query_Filters_Call) Run(run func()) *Query_Filters_Call

func (*Query_Filters_Call) RunAndReturn

func (_c *Query_Filters_Call) RunAndReturn(run func() query.Filters[any]) *Query_Filters_Call

type Query_IncludedResourceObjects_Call

type Query_IncludedResourceObjects_Call struct {
	*mock.Call
}

Query_IncludedResourceObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncludedResourceObjects'

func (*Query_IncludedResourceObjects_Call) Return

func (*Query_IncludedResourceObjects_Call) Run

func (*Query_IncludedResourceObjects_Call) RunAndReturn

type Query_Merge_Call

type Query_Merge_Call struct {
	*mock.Call
}

Query_Merge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Merge'

func (*Query_Merge_Call) Return

func (_c *Query_Merge_Call) Return() *Query_Merge_Call

func (*Query_Merge_Call) Run

func (_c *Query_Merge_Call) Run(run func(q query.Query)) *Query_Merge_Call

func (*Query_Merge_Call) RunAndReturn

func (_c *Query_Merge_Call) RunAndReturn(run func(q query.Query)) *Query_Merge_Call

type Query_Pagination_Call

type Query_Pagination_Call struct {
	*mock.Call
}

Query_Pagination_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pagination'

func (*Query_Pagination_Call) Return

func (_c *Query_Pagination_Call) Return(paginationParams *query.PaginationParams) *Query_Pagination_Call

func (*Query_Pagination_Call) Run

func (_c *Query_Pagination_Call) Run(run func()) *Query_Pagination_Call

func (*Query_Pagination_Call) RunAndReturn

func (_c *Query_Pagination_Call) RunAndReturn(run func() *query.PaginationParams) *Query_Pagination_Call

type Query_Sorting_Call

type Query_Sorting_Call struct {
	*mock.Call
}

Query_Sorting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sorting'

func (*Query_Sorting_Call) Return

func (_c *Query_Sorting_Call) Return(sortingParams *query.SortingParams) *Query_Sorting_Call

func (*Query_Sorting_Call) Run

func (_c *Query_Sorting_Call) Run(run func()) *Query_Sorting_Call

func (*Query_Sorting_Call) RunAndReturn

func (_c *Query_Sorting_Call) RunAndReturn(run func() *query.SortingParams) *Query_Sorting_Call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL