mocks

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClienterMock

type ClienterMock struct {
	// CheckerFunc mocks the Checker method.
	CheckerFunc func(ctx context.Context, check *healthcheck.CheckState) error

	// GetNavigationPublicFunc mocks the GetNavigationPublic method.
	GetNavigationPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, errors.Error)

	// GetRootTopicsPrivateFunc mocks the GetRootTopicsPrivate method.
	GetRootTopicsPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, errors.Error)

	// GetRootTopicsPublicFunc mocks the GetRootTopicsPublic method.
	GetRootTopicsPublicFunc func(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, errors.Error)

	// GetSubtopicsPrivateFunc mocks the GetSubtopicsPrivate method.
	GetSubtopicsPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, errors.Error)

	// GetSubtopicsPublicFunc mocks the GetSubtopicsPublic method.
	GetSubtopicsPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, errors.Error)

	// GetTopicPrivateFunc mocks the GetTopicPrivate method.
	GetTopicPrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, errors.Error)

	// GetTopicPublicFunc mocks the GetTopicPublic method.
	GetTopicPublicFunc func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, errors.Error)

	// HealthFunc mocks the Health method.
	HealthFunc func() *health.Client

	// PutTopicReleasePrivateFunc mocks the PutTopicReleasePrivate method.
	PutTopicReleasePrivateFunc func(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, errors.Error)

	// URLFunc mocks the URL method.
	URLFunc func() string
	// contains filtered or unexported fields
}

ClienterMock is a mock implementation of sdk.Clienter.

    func TestSomethingThatUsesClienter(t *testing.T) {

        // make and configure a mocked sdk.Clienter
        mockedClienter := &ClienterMock{
            CheckerFunc: func(ctx context.Context, check *healthcheck.CheckState) error {
	               panic("mock out the Checker method")
            },
            GetNavigationPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, errors.Error) {
	               panic("mock out the GetNavigationPublic method")
            },
            GetRootTopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, errors.Error) {
	               panic("mock out the GetRootTopicsPrivate method")
            },
            GetRootTopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, errors.Error) {
	               panic("mock out the GetRootTopicsPublic method")
            },
            GetSubtopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, errors.Error) {
	               panic("mock out the GetSubtopicsPrivate method")
            },
            GetSubtopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, errors.Error) {
	               panic("mock out the GetSubtopicsPublic method")
            },
            GetTopicPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, errors.Error) {
	               panic("mock out the GetTopicPrivate method")
            },
            GetTopicPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, errors.Error) {
	               panic("mock out the GetTopicPublic method")
            },
            HealthFunc: func() *health.Client {
	               panic("mock out the Health method")
            },
            PutTopicReleasePrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, errors.Error) {
	               panic("mock out the PutTopicReleasePrivate method")
            },
            URLFunc: func() string {
	               panic("mock out the URL method")
            },
        }

        // use mockedClienter in code that requires sdk.Clienter
        // and then make assertions.

    }

func (*ClienterMock) Checker

func (mock *ClienterMock) Checker(ctx context.Context, check *healthcheck.CheckState) error

Checker calls CheckerFunc.

func (*ClienterMock) CheckerCalls

func (mock *ClienterMock) CheckerCalls() []struct {
	Ctx   context.Context
	Check *healthcheck.CheckState
}

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

len(mockedClienter.CheckerCalls())

func (*ClienterMock) GetNavigationPublic added in v0.12.0

func (mock *ClienterMock) GetNavigationPublic(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, errors.Error)

GetNavigationPublic calls GetNavigationPublicFunc.

func (*ClienterMock) GetNavigationPublicCalls added in v0.12.0

func (mock *ClienterMock) GetNavigationPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	Options    sdk.Options
}

GetNavigationPublicCalls gets all the calls that were made to GetNavigationPublic. Check the length with:

len(mockedClienter.GetNavigationPublicCalls())

func (*ClienterMock) GetRootTopicsPrivate

func (mock *ClienterMock) GetRootTopicsPrivate(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, errors.Error)

GetRootTopicsPrivate calls GetRootTopicsPrivateFunc.

func (*ClienterMock) GetRootTopicsPrivateCalls

func (mock *ClienterMock) GetRootTopicsPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
}

GetRootTopicsPrivateCalls gets all the calls that were made to GetRootTopicsPrivate. Check the length with:

len(mockedClienter.GetRootTopicsPrivateCalls())

func (*ClienterMock) GetRootTopicsPublic

func (mock *ClienterMock) GetRootTopicsPublic(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, errors.Error)

GetRootTopicsPublic calls GetRootTopicsPublicFunc.

func (*ClienterMock) GetRootTopicsPublicCalls

func (mock *ClienterMock) GetRootTopicsPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
}

GetRootTopicsPublicCalls gets all the calls that were made to GetRootTopicsPublic. Check the length with:

len(mockedClienter.GetRootTopicsPublicCalls())

func (*ClienterMock) GetSubtopicsPrivate

func (mock *ClienterMock) GetSubtopicsPrivate(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, errors.Error)

GetSubtopicsPrivate calls GetSubtopicsPrivateFunc.

func (*ClienterMock) GetSubtopicsPrivateCalls

func (mock *ClienterMock) GetSubtopicsPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetSubtopicsPrivateCalls gets all the calls that were made to GetSubtopicsPrivate. Check the length with:

len(mockedClienter.GetSubtopicsPrivateCalls())

func (*ClienterMock) GetSubtopicsPublic

func (mock *ClienterMock) GetSubtopicsPublic(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, errors.Error)

GetSubtopicsPublic calls GetSubtopicsPublicFunc.

func (*ClienterMock) GetSubtopicsPublicCalls

func (mock *ClienterMock) GetSubtopicsPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetSubtopicsPublicCalls gets all the calls that were made to GetSubtopicsPublic. Check the length with:

len(mockedClienter.GetSubtopicsPublicCalls())

func (*ClienterMock) GetTopicPrivate added in v0.13.4

func (mock *ClienterMock) GetTopicPrivate(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.TopicResponse, errors.Error)

GetTopicPrivate calls GetTopicPrivateFunc.

func (*ClienterMock) GetTopicPrivateCalls added in v0.13.4

func (mock *ClienterMock) GetTopicPrivateCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetTopicPrivateCalls gets all the calls that were made to GetTopicPrivate. Check the length with:

len(mockedClienter.GetTopicPrivateCalls())

func (*ClienterMock) GetTopicPublic added in v0.13.4

func (mock *ClienterMock) GetTopicPublic(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.Topic, errors.Error)

GetTopicPublic calls GetTopicPublicFunc.

func (*ClienterMock) GetTopicPublicCalls added in v0.13.4

func (mock *ClienterMock) GetTopicPublicCalls() []struct {
	Ctx        context.Context
	ReqHeaders sdk.Headers
	ID         string
}

GetTopicPublicCalls gets all the calls that were made to GetTopicPublic. Check the length with:

len(mockedClienter.GetTopicPublicCalls())

func (*ClienterMock) Health

func (mock *ClienterMock) Health() *health.Client

Health calls HealthFunc.

func (*ClienterMock) HealthCalls

func (mock *ClienterMock) HealthCalls() []struct {
}

HealthCalls gets all the calls that were made to Health. Check the length with:

len(mockedClienter.HealthCalls())

func (*ClienterMock) PutTopicReleasePrivate added in v0.14.0

func (mock *ClienterMock) PutTopicReleasePrivate(ctx context.Context, reqHeaders sdk.Headers, id string, topicRelease []byte) (*sdk.ResponseInfo, errors.Error)

PutTopicReleasePrivate calls PutTopicReleasePrivateFunc.

func (*ClienterMock) PutTopicReleasePrivateCalls added in v0.14.0

func (mock *ClienterMock) PutTopicReleasePrivateCalls() []struct {
	Ctx          context.Context
	ReqHeaders   sdk.Headers
	ID           string
	TopicRelease []byte
}

PutTopicReleasePrivateCalls gets all the calls that were made to PutTopicReleasePrivate. Check the length with:

len(mockedClienter.PutTopicReleasePrivateCalls())

func (*ClienterMock) URL

func (mock *ClienterMock) URL() string

URL calls URLFunc.

func (*ClienterMock) URLCalls

func (mock *ClienterMock) URLCalls() []struct {
}

URLCalls gets all the calls that were made to URL. Check the length with:

len(mockedClienter.URLCalls())

Jump to

Keyboard shortcuts

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