todostest

package
v0.0.0-...-c4f498c Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 4 Imported by: 0

README

todostest

This package should be named using [domain]test format, which is also used by standard package such as net/http/httptest.

If needed, this package may also contains additional function that act as helper for mocking (see todo.go).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mock

func Mock(service *Service, funcs ...MockFunc)

Mock apply mock todo functions.

Types

type MockFunc

type MockFunc func(service *Service)

MockFunc function.

func MockClear

func MockClear() MockFunc

MockClear util.

func MockCreate

func MockCreate(result todos.Todo, err error) MockFunc

MockCreate util.

func MockDelete

func MockDelete() MockFunc

MockDelete util.

func MockSearch

func MockSearch(result []todos.Todo, filter todos.Filter, err error) MockFunc

MockSearch util.

func MockUpdate

func MockUpdate(result todos.Todo, err error) MockFunc

MockUpdate util.

type Service

type Service struct {
	mock.Mock
}

Service is an autogenerated mock type for the Service type

func (*Service) Clear

func (_m *Service) Clear(ctx context.Context)

Clear provides a mock function with given fields: ctx

func (*Service) Create

func (_m *Service) Create(ctx context.Context, todo *todos.Todo) error

Create provides a mock function with given fields: ctx, todo

func (*Service) Delete

func (_m *Service) Delete(ctx context.Context, todo *todos.Todo)

Delete provides a mock function with given fields: ctx, todo

func (*Service) Search

func (_m *Service) Search(ctx context.Context, _a1 *[]todos.Todo, filter todos.Filter) error

Search provides a mock function with given fields: ctx, _a1, filter

func (*Service) Update

func (_m *Service) Update(ctx context.Context, todo *todos.Todo, changes rel.Changeset) error

Update provides a mock function with given fields: ctx, todo, changes

Jump to

Keyboard shortcuts

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