fake

package
v0.0.0-...-67b0140 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockEvaluationHandler

type MockEvaluationHandler struct {
	// ReconcileEvaluationsFunc mocks the ReconcileEvaluations method.
	ReconcileEvaluationsFunc func(ctx context.Context, phaseCtx context.Context, reconcileObject client.Object, evaluationCreateAttributes evaluation.CreateEvaluationAttributes) ([]apilifecycle.ItemStatus, apicommon.StatusSummary, error)
	// contains filtered or unexported fields
}

MockEvaluationHandler is a mock implementation of evaluation.IEvaluationHandler.

func TestSomethingThatUsesIEvaluationHandler(t *testing.T) {

	// make and configure a mocked evaluation.IEvaluationHandler
	mockedIEvaluationHandler := &MockEvaluationHandler{
		ReconcileEvaluationsFunc: func(ctx context.Context, phaseCtx context.Context, reconcileObject client.Object, evaluationCreateAttributes evaluation.CreateEvaluationAttributes) ([]apilifecycle.ItemStatus, apicommon.StatusSummary, error) {
			panic("mock out the ReconcileEvaluations method")
		},
	}

	// use mockedIEvaluationHandler in code that requires evaluation.IEvaluationHandler
	// and then make assertions.

}

func (*MockEvaluationHandler) ReconcileEvaluations

func (mock *MockEvaluationHandler) ReconcileEvaluations(ctx context.Context, phaseCtx context.Context, reconcileObject client.Object, evaluationCreateAttributes evaluation.CreateEvaluationAttributes) ([]apilifecycle.ItemStatus, apicommon.StatusSummary, error)

ReconcileEvaluations calls ReconcileEvaluationsFunc.

func (*MockEvaluationHandler) ReconcileEvaluationsCalls

func (mock *MockEvaluationHandler) ReconcileEvaluationsCalls() []struct {
	Ctx                        context.Context
	PhaseCtx                   context.Context
	ReconcileObject            client.Object
	EvaluationCreateAttributes evaluation.CreateEvaluationAttributes
}

ReconcileEvaluationsCalls gets all the calls that were made to ReconcileEvaluations. Check the length with:

len(mockedIEvaluationHandler.ReconcileEvaluationsCalls())

Jump to

Keyboard shortcuts

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