fake

package
v0.0.0-...-14494c5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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 MockConfig

type MockConfig struct {
	// GetCreationRequestTimeoutFunc mocks the GetCreationRequestTimeout method.
	GetCreationRequestTimeoutFunc func() time.Duration

	// SetCreationRequestTimeoutFunc mocks the SetCreationRequestTimeout method.
	SetCreationRequestTimeoutFunc func(value time.Duration)
	// contains filtered or unexported fields
}

MockConfig is a mock implementation of config.IConfig.

func TestSomethingThatUsesIConfig(t *testing.T) {

	// make and configure a mocked config.IConfig
	mockedIConfig := &MockConfig{
		GetCreationRequestTimeoutFunc: func() time.Duration {
			panic("mock out the GetCreationRequestTimeout method")
		},
		SetCreationRequestTimeoutFunc: func(value time.Duration)  {
			panic("mock out the SetCreationRequestTimeout method")
		},
	}

	// use mockedIConfig in code that requires config.IConfig
	// and then make assertions.

}

func (*MockConfig) GetCreationRequestTimeout

func (mock *MockConfig) GetCreationRequestTimeout() time.Duration

GetCreationRequestTimeout calls GetCreationRequestTimeoutFunc.

func (*MockConfig) GetCreationRequestTimeoutCalls

func (mock *MockConfig) GetCreationRequestTimeoutCalls() []struct {
}

GetCreationRequestTimeoutCalls gets all the calls that were made to GetCreationRequestTimeout. Check the length with:

len(mockedIConfig.GetCreationRequestTimeoutCalls())

func (*MockConfig) SetCreationRequestTimeout

func (mock *MockConfig) SetCreationRequestTimeout(value time.Duration)

SetCreationRequestTimeout calls SetCreationRequestTimeoutFunc.

func (*MockConfig) SetCreationRequestTimeoutCalls

func (mock *MockConfig) SetCreationRequestTimeoutCalls() []struct {
	Value time.Duration
}

SetCreationRequestTimeoutCalls gets all the calls that were made to SetCreationRequestTimeout. Check the length with:

len(mockedIConfig.SetCreationRequestTimeoutCalls())

Jump to

Keyboard shortcuts

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