mock

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CantabularClientMock

type CantabularClientMock struct {
	// GetCodebookFunc mocks the GetCodebook method.
	GetCodebookFunc func(contextMoqParam context.Context, getCodebookRequest cantabular.GetCodebookRequest) (*cantabular.GetCodebookResponse, error)
	// contains filtered or unexported fields
}

CantabularClientMock is a mock implementation of handler.CantabularClient.

func TestSomethingThatUsesCantabularClient(t *testing.T) {

	// make and configure a mocked handler.CantabularClient
	mockedCantabularClient := &CantabularClientMock{
		GetCodebookFunc: func(contextMoqParam context.Context, getCodebookRequest cantabular.GetCodebookRequest) (*cantabular.GetCodebookResponse, error) {
			panic("mock out the GetCodebook method")
		},
	}

	// use mockedCantabularClient in code that requires handler.CantabularClient
	// and then make assertions.

}

func (*CantabularClientMock) GetCodebook

func (mock *CantabularClientMock) GetCodebook(contextMoqParam context.Context, getCodebookRequest cantabular.GetCodebookRequest) (*cantabular.GetCodebookResponse, error)

GetCodebook calls GetCodebookFunc.

func (*CantabularClientMock) GetCodebookCalls

func (mock *CantabularClientMock) GetCodebookCalls() []struct {
	ContextMoqParam    context.Context
	GetCodebookRequest cantabular.GetCodebookRequest
}

GetCodebookCalls gets all the calls that were made to GetCodebook. Check the length with:

len(mockedCantabularClient.GetCodebookCalls())

type DatasetAPIClientMock

type DatasetAPIClientMock struct {
	// PutInstanceFunc mocks the PutInstance method.
	PutInstanceFunc func(contextMoqParam context.Context, s1 string, s2 string, s3 string, s4 string, updateInstance dataset.UpdateInstance) error
	// contains filtered or unexported fields
}

DatasetAPIClientMock is a mock implementation of handler.DatasetAPIClient.

func TestSomethingThatUsesDatasetAPIClient(t *testing.T) {

	// make and configure a mocked handler.DatasetAPIClient
	mockedDatasetAPIClient := &DatasetAPIClientMock{
		PutInstanceFunc: func(contextMoqParam context.Context, s1 string, s2 string, s3 string, s4 string, updateInstance dataset.UpdateInstance) error {
			panic("mock out the PutInstance method")
		},
	}

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

}

func (*DatasetAPIClientMock) PutInstance

func (mock *DatasetAPIClientMock) PutInstance(contextMoqParam context.Context, s1 string, s2 string, s3 string, s4 string, updateInstance dataset.UpdateInstance) error

PutInstance calls PutInstanceFunc.

func (*DatasetAPIClientMock) PutInstanceCalls

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

PutInstanceCalls gets all the calls that were made to PutInstance. Check the length with:

len(mockedDatasetAPIClient.PutInstanceCalls())

type RecipeAPIClientMock

type RecipeAPIClientMock struct {
	// GetRecipeFunc mocks the GetRecipe method.
	GetRecipeFunc func(contextMoqParam context.Context, s1 string, s2 string, s3 string) (*recipe.Recipe, error)
	// contains filtered or unexported fields
}

RecipeAPIClientMock is a mock implementation of handler.RecipeAPIClient.

func TestSomethingThatUsesRecipeAPIClient(t *testing.T) {

	// make and configure a mocked handler.RecipeAPIClient
	mockedRecipeAPIClient := &RecipeAPIClientMock{
		GetRecipeFunc: func(contextMoqParam context.Context, s1 string, s2 string, s3 string) (*recipe.Recipe, error) {
			panic("mock out the GetRecipe method")
		},
	}

	// use mockedRecipeAPIClient in code that requires handler.RecipeAPIClient
	// and then make assertions.

}

func (*RecipeAPIClientMock) GetRecipe

func (mock *RecipeAPIClientMock) GetRecipe(contextMoqParam context.Context, s1 string, s2 string, s3 string) (*recipe.Recipe, error)

GetRecipe calls GetRecipeFunc.

func (*RecipeAPIClientMock) GetRecipeCalls

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

GetRecipeCalls gets all the calls that were made to GetRecipe. Check the length with:

len(mockedRecipeAPIClient.GetRecipeCalls())

Jump to

Keyboard shortcuts

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