mock

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 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 DatasetAPIClientMock added in v0.5.0

type DatasetAPIClientMock struct {
	// PutInstanceStateFunc mocks the PutInstanceState method.
	PutInstanceStateFunc func(contextMoqParam context.Context, s1 string, s2 string, state dataset.State, s3 string) (string, error)
	// contains filtered or unexported fields
}

DatasetAPIClientMock is a mock implementation of event.DatasetAPIClient.

func TestSomethingThatUsesDatasetAPIClient(t *testing.T) {

	// make and configure a mocked event.DatasetAPIClient
	mockedDatasetAPIClient := &DatasetAPIClientMock{
		PutInstanceStateFunc: func(contextMoqParam context.Context, s1 string, s2 string, state dataset.State, s3 string) (string, error) {
			panic("mock out the PutInstanceState method")
		},
	}

	// use mockedDatasetAPIClient in code that requires event.DatasetAPIClient
	// and then make assertions.

}

func (*DatasetAPIClientMock) PutInstanceState added in v0.5.0

func (mock *DatasetAPIClientMock) PutInstanceState(contextMoqParam context.Context, s1 string, s2 string, state dataset.State, s3 string) (string, error)

PutInstanceState calls PutInstanceStateFunc.

func (*DatasetAPIClientMock) PutInstanceStateCalls added in v0.5.0

func (mock *DatasetAPIClientMock) PutInstanceStateCalls() []struct {
	ContextMoqParam context.Context
	S1              string
	S2              string
	State           dataset.State
	S3              string
}

PutInstanceStateCalls gets all the calls that were made to PutInstanceState. Check the length with:

len(mockedDatasetAPIClient.PutInstanceStateCalls())

type HandlerMock

type HandlerMock struct {
	// HandleFunc mocks the Handle method.
	HandleFunc func(contextMoqParam context.Context, instanceStarted *event.InstanceStarted) error
	// contains filtered or unexported fields
}

HandlerMock is a mock implementation of event.Handler.

func TestSomethingThatUsesHandler(t *testing.T) {

	// make and configure a mocked event.Handler
	mockedHandler := &HandlerMock{
		HandleFunc: func(contextMoqParam context.Context, instanceStarted *event.InstanceStarted) error {
			panic("mock out the Handle method")
		},
	}

	// use mockedHandler in code that requires event.Handler
	// and then make assertions.

}

func (*HandlerMock) Handle

func (mock *HandlerMock) Handle(contextMoqParam context.Context, instanceStarted *event.InstanceStarted) error

Handle calls HandleFunc.

func (*HandlerMock) HandleCalls

func (mock *HandlerMock) HandleCalls() []struct {
	ContextMoqParam context.Context
	InstanceStarted *event.InstanceStarted
}

HandleCalls gets all the calls that were made to Handle. Check the length with:

len(mockedHandler.HandleCalls())

type ImportAPIClientMock added in v0.5.0

type ImportAPIClientMock struct {
	// UpdateImportJobStateFunc mocks the UpdateImportJobState method.
	UpdateImportJobStateFunc func(contextMoqParam context.Context, s1 string, s2 string, s3 string) error
	// contains filtered or unexported fields
}

ImportAPIClientMock is a mock implementation of event.ImportAPIClient.

func TestSomethingThatUsesImportAPIClient(t *testing.T) {

	// make and configure a mocked event.ImportAPIClient
	mockedImportAPIClient := &ImportAPIClientMock{
		UpdateImportJobStateFunc: func(contextMoqParam context.Context, s1 string, s2 string, s3 string) error {
			panic("mock out the UpdateImportJobState method")
		},
	}

	// use mockedImportAPIClient in code that requires event.ImportAPIClient
	// and then make assertions.

}

func (*ImportAPIClientMock) UpdateImportJobState added in v0.5.0

func (mock *ImportAPIClientMock) UpdateImportJobState(contextMoqParam context.Context, s1 string, s2 string, s3 string) error

UpdateImportJobState calls UpdateImportJobStateFunc.

func (*ImportAPIClientMock) UpdateImportJobStateCalls added in v0.5.0

func (mock *ImportAPIClientMock) UpdateImportJobStateCalls() []struct {
	ContextMoqParam context.Context
	S1              string
	S2              string
	S3              string
}

UpdateImportJobStateCalls gets all the calls that were made to UpdateImportJobState. Check the length with:

len(mockedImportAPIClient.UpdateImportJobStateCalls())

Jump to

Keyboard shortcuts

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