fake

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserInputMock

type IUserInputMock struct {
	// AskBoolFunc mocks the AskBool method.
	AskBoolFunc func(question string, opts *common.UserInputOptions) bool
	// contains filtered or unexported fields
}

IUserInputMock is a mock implementation of common.IUserInput.

func TestSomethingThatUsesIUserInput(t *testing.T) {

	// make and configure a mocked common.IUserInput
	mockedIUserInput := &IUserInputMock{
		AskBoolFunc: func(question string, opts *common.UserInputOptions) bool {
			panic("mock out the AskBool method")
		},
	}

	// use mockedIUserInput in code that requires common.IUserInput
	// and then make assertions.

}

func (*IUserInputMock) AskBool

func (mock *IUserInputMock) AskBool(question string, opts *common.UserInputOptions) bool

AskBool calls AskBoolFunc.

func (*IUserInputMock) AskBoolCalls

func (mock *IUserInputMock) AskBoolCalls() []struct {
	Question string
	Opts     *common.UserInputOptions
}

AskBoolCalls gets all the calls that were made to AskBool. Check the length with:

len(mockedIUserInput.AskBoolCalls())

Jump to

Keyboard shortcuts

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