mocks

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 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 *health.CheckState) error

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

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

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

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

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

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

	// 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 *health.CheckState) error {
			panic("mock out the Checker method")
		},
		GetNavigationPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, options sdk.Options) (*models.Navigation, apiError.Error) {
			panic("mock out the GetNavigationPublic method")
		},
		GetRootTopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PrivateSubtopics, apiError.Error) {
			panic("mock out the GetRootTopicsPrivate method")
		},
		GetRootTopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers) (*models.PublicSubtopics, apiError.Error) {
			panic("mock out the GetRootTopicsPublic method")
		},
		GetSubtopicsPrivateFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PrivateSubtopics, apiError.Error) {
			panic("mock out the GetSubtopicsPrivate method")
		},
		GetSubtopicsPublicFunc: func(ctx context.Context, reqHeaders sdk.Headers, id string) (*models.PublicSubtopics, apiError.Error) {
			panic("mock out the GetSubtopicsPublic method")
		},
		HealthFunc: func() *healthcheck.Client {
			panic("mock out the Health 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 *health.CheckState) error

Checker calls CheckerFunc.

func (*ClienterMock) CheckerCalls

func (mock *ClienterMock) CheckerCalls() []struct {
	Ctx   context.Context
	Check *health.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, apiError.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, apiError.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, apiError.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, apiError.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, apiError.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) Health

func (mock *ClienterMock) Health() *healthcheck.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) 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