test

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneSource

func CloneSource(datum *dataSource.Source) *dataSource.Source

func CloneSourceArray added in v1.31.0

func CloneSourceArray(datum dataSource.SourceArray) dataSource.SourceArray

func CloneUpdate

func CloneUpdate(datum *dataSource.Update) *dataSource.Update

func MatchSource added in v1.31.0

func MatchSource(datum *dataSource.Source) gomegaTypes.GomegaMatcher

func MatchSourceArray added in v1.31.0

func MatchSourceArray(datum dataSource.SourceArray) gomegaTypes.GomegaMatcher

func MatchUpdate added in v1.31.0

func MatchUpdate(datum *dataSource.Update) gomegaTypes.GomegaMatcher

func NewObjectFromCreate

func NewObjectFromCreate(datum *dataSource.Create, objectFormat test.ObjectFormat) map[string]interface{}

func NewObjectFromFilter

func NewObjectFromFilter(datum *dataSource.Filter, objectFormat test.ObjectFormat) map[string]interface{}

func NewObjectFromSource

func NewObjectFromSource(datum *dataSource.Source, objectFormat test.ObjectFormat) map[string]interface{}

func NewObjectFromUpdate

func NewObjectFromUpdate(datum *dataSource.Update, objectFormat test.ObjectFormat) map[string]interface{}

func RandomCreate

func RandomCreate() *dataSource.Create

func RandomFilter

func RandomFilter() *dataSource.Filter

func RandomID

func RandomID() string

func RandomSource

func RandomSource() *dataSource.Source

func RandomSourceArray added in v1.31.0

func RandomSourceArray(minimumLength int, maximumLength int) dataSource.SourceArray

func RandomState

func RandomState() string

func RandomStates

func RandomStates() []string

func RandomUpdate

func RandomUpdate() *dataSource.Update

Types

type Client

type Client struct {
	ListInvocations      int
	ListInputs           []ListInput
	ListStub             func(ctx context.Context, userID string, filter *dataSource.Filter, pagination *page.Pagination) (dataSource.SourceArray, error)
	ListOutputs          []ListOutput
	ListOutput           *ListOutput
	CreateInvocations    int
	CreateInputs         []CreateInput
	CreateStub           func(ctx context.Context, userID string, create *dataSource.Create) (*dataSource.Source, error)
	CreateOutputs        []CreateOutput
	CreateOutput         *CreateOutput
	DeleteAllInvocations int
	DeleteAllInputs      []string
	DeleteAllStub        func(ctx context.Context, id string) error
	DeleteAllOutputs     []error
	DeleteAllOutput      *error
	GetInvocations       int
	GetInputs            []string
	GetStub              func(ctx context.Context, id string) (*dataSource.Source, error)
	GetOutputs           []GetOutput
	GetOutput            *GetOutput
	UpdateInvocations    int
	UpdateInputs         []UpdateInput
	UpdateStub           func(ctx context.Context, id string, condition *request.Condition, create *dataSource.Update) (*dataSource.Source, error)
	UpdateOutputs        []UpdateOutput
	UpdateOutput         *UpdateOutput
	DeleteInvocations    int
	DeleteInputs         []DeleteInput
	DeleteStub           func(ctx context.Context, id string, condition *request.Condition) (bool, error)
	DeleteOutputs        []DeleteOutput
	DeleteOutput         *DeleteOutput
}

func NewClient

func NewClient() *Client

func (*Client) AssertOutputsEmpty

func (c *Client) AssertOutputsEmpty()

func (*Client) Create

func (c *Client) Create(ctx context.Context, userID string, create *dataSource.Create) (*dataSource.Source, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id string, condition *request.Condition) (bool, error)

func (*Client) DeleteAll added in v1.31.0

func (c *Client) DeleteAll(ctx context.Context, userID string) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, id string) (*dataSource.Source, error)

func (*Client) List

func (c *Client) List(ctx context.Context, userID string, filter *dataSource.Filter, pagination *page.Pagination) (dataSource.SourceArray, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, id string, condition *request.Condition, update *dataSource.Update) (*dataSource.Source, error)

type CreateInput

type CreateInput struct {
	UserID string
	Create *dataSource.Create
}

type CreateOutput

type CreateOutput struct {
	Source *dataSource.Source
	Error  error
}

type DeleteInput

type DeleteInput struct {
	ID        string
	Condition *request.Condition
}

type DeleteOutput

type DeleteOutput struct {
	Deleted bool
	Error   error
}

type GetOutput

type GetOutput struct {
	Source *dataSource.Source
	Error  error
}

type ListInput

type ListInput struct {
	UserID     string
	Filter     *dataSource.Filter
	Pagination *page.Pagination
}

type ListOutput

type ListOutput struct {
	SourceArray dataSource.SourceArray
	Error       error
}

type UpdateInput

type UpdateInput struct {
	ID        string
	Condition *request.Condition
	Update    *dataSource.Update
}

type UpdateOutput

type UpdateOutput struct {
	Source *dataSource.Source
	Error  error
}

Jump to

Keyboard shortcuts

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