filtertest

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientMock

type ClientMock struct {
	// GetOutputBytesFunc mocks the GetOutputBytes method.
	GetOutputBytesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error)

	// UpdateFilterOutputBytesFunc mocks the UpdateFilterOutputBytes method.
	UpdateFilterOutputBytesFunc func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error
	// contains filtered or unexported fields
}

ClientMock is a mock implementation of filter.Client.

func TestSomethingThatUsesClient(t *testing.T) {

	// make and configure a mocked filter.Client
	mockedClient := &ClientMock{
		GetOutputBytesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error) {
			panic("mock out the GetOutputBytes method")
		},
		UpdateFilterOutputBytesFunc: func(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error {
			panic("mock out the UpdateFilterOutputBytes method")
		},
	}

	// use mockedClient in code that requires filter.Client
	// and then make assertions.

}

func (*ClientMock) GetOutputBytes

func (mock *ClientMock) GetOutputBytes(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, collectionID string, filterOutputID string) ([]byte, error)

GetOutputBytes calls GetOutputBytesFunc.

func (*ClientMock) GetOutputBytesCalls

func (mock *ClientMock) GetOutputBytesCalls() []struct {
	Ctx                  context.Context
	UserAuthToken        string
	ServiceAuthToken     string
	DownloadServiceToken string
	CollectionID         string
	FilterOutputID       string
}

GetOutputBytesCalls gets all the calls that were made to GetOutputBytes. Check the length with:

len(mockedClient.GetOutputBytesCalls())

func (*ClientMock) UpdateFilterOutputBytes

func (mock *ClientMock) UpdateFilterOutputBytes(ctx context.Context, userAuthToken string, serviceAuthToken string, downloadServiceToken string, filterJobID string, b []byte) error

UpdateFilterOutputBytes calls UpdateFilterOutputBytesFunc.

func (*ClientMock) UpdateFilterOutputBytesCalls

func (mock *ClientMock) UpdateFilterOutputBytesCalls() []struct {
	Ctx                  context.Context
	UserAuthToken        string
	ServiceAuthToken     string
	DownloadServiceToken string
	FilterJobID          string
	B                    []byte
}

UpdateFilterOutputBytesCalls gets all the calls that were made to UpdateFilterOutputBytes. Check the length with:

len(mockedClient.UpdateFilterOutputBytesCalls())

Jump to

Keyboard shortcuts

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