mock

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 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 ZebedeeClientMock

type ZebedeeClientMock struct {
	// CheckerFunc mocks the Checker method.
	CheckerFunc func(in1 context.Context, in2 *healthcheck.CheckState) error

	// GetPublishedDataFunc mocks the GetPublishedData method.
	GetPublishedDataFunc func(ctx context.Context, uriString string) ([]byte, error)
	// contains filtered or unexported fields
}

ZebedeeClientMock is a mock implementation of clients.ZebedeeClient.

    func TestSomethingThatUsesZebedeeClient(t *testing.T) {

        // make and configure a mocked clients.ZebedeeClient
        mockedZebedeeClient := &ZebedeeClientMock{
            CheckerFunc: func(in1 context.Context, in2 *healthcheck.CheckState) error {
	               panic("mock out the Checker method")
            },
            GetPublishedDataFunc: func(ctx context.Context, uriString string) ([]byte, error) {
	               panic("mock out the GetPublishedData method")
            },
        }

        // use mockedZebedeeClient in code that requires clients.ZebedeeClient
        // and then make assertions.

    }

func (*ZebedeeClientMock) Checker

func (mock *ZebedeeClientMock) Checker(in1 context.Context, in2 *healthcheck.CheckState) error

Checker calls CheckerFunc.

func (*ZebedeeClientMock) CheckerCalls

func (mock *ZebedeeClientMock) CheckerCalls() []struct {
	In1 context.Context
	In2 *healthcheck.CheckState
}

CheckerCalls gets all the calls that were made to Checker. Check the length with:

len(mockedZebedeeClient.CheckerCalls())

func (*ZebedeeClientMock) GetPublishedData

func (mock *ZebedeeClientMock) GetPublishedData(ctx context.Context, uriString string) ([]byte, error)

GetPublishedData calls GetPublishedDataFunc.

func (*ZebedeeClientMock) GetPublishedDataCalls

func (mock *ZebedeeClientMock) GetPublishedDataCalls() []struct {
	Ctx       context.Context
	UriString string
}

GetPublishedDataCalls gets all the calls that were made to GetPublishedData. Check the length with:

len(mockedZebedeeClient.GetPublishedDataCalls())

Jump to

Keyboard shortcuts

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