mocks_routes

package
v0.0.0-...-ab02cca Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InteractivesAPIClientMock

type InteractivesAPIClientMock struct {
	// ListInteractivesFunc mocks the ListInteractives method.
	ListInteractivesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, f *interactives.Filter) ([]interactives.Interactive, error)
	// contains filtered or unexported fields
}

InteractivesAPIClientMock is a mock implementation of routes.InteractivesAPIClient.

func TestSomethingThatUsesInteractivesAPIClient(t *testing.T) {

	// make and configure a mocked routes.InteractivesAPIClient
	mockedInteractivesAPIClient := &InteractivesAPIClientMock{
		ListInteractivesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, f *interactives.Filter) ([]interactives.Interactive, error) {
			panic("mock out the ListInteractives method")
		},
	}

	// use mockedInteractivesAPIClient in code that requires routes.InteractivesAPIClient
	// and then make assertions.

}

func (*InteractivesAPIClientMock) ListInteractives

func (mock *InteractivesAPIClientMock) ListInteractives(ctx context.Context, userAuthToken string, serviceAuthToken string, f *interactives.Filter) ([]interactives.Interactive, error)

ListInteractives calls ListInteractivesFunc.

func (*InteractivesAPIClientMock) ListInteractivesCalls

func (mock *InteractivesAPIClientMock) ListInteractivesCalls() []struct {
	Ctx              context.Context
	UserAuthToken    string
	ServiceAuthToken string
	F                *interactives.Filter
}

ListInteractivesCalls gets all the calls that were made to ListInteractives. Check the length with:

len(mockedInteractivesAPIClient.ListInteractivesCalls())

Jump to

Keyboard shortcuts

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