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 IShipyardRetrieverMock

type IShipyardRetrieverMock struct {
	// GetCachedShipyardFunc mocks the GetCachedShipyard method.
	GetCachedShipyardFunc func(projectName string) (*keptnv2.Shipyard, error)

	// GetLatestCommitIDFunc mocks the GetLatestCommitID method.
	GetLatestCommitIDFunc func(projectName string, stageName string) (string, error)

	// GetShipyardFunc mocks the GetShipyard method.
	GetShipyardFunc func(projectName string) (*keptnv2.Shipyard, error)
	// contains filtered or unexported fields
}

IShipyardRetrieverMock is a mock implementation of shipyardretriever.IShipyardRetriever.

func TestSomethingThatUsesIShipyardRetriever(t *testing.T) {

	// make and configure a mocked shipyardretriever.IShipyardRetriever
	mockedIShipyardRetriever := &IShipyardRetrieverMock{
		GetCachedShipyardFunc: func(projectName string) (*keptnv2.Shipyard, error) {
			panic("mock out the GetCachedShipyard method")
		},
		GetLatestCommitIDFunc: func(projectName string, stageName string) (string, error) {
			panic("mock out the GetLatestCommitID method")
		},
		GetShipyardFunc: func(projectName string) (*keptnv2.Shipyard, error) {
			panic("mock out the GetShipyard method")
		},
	}

	// use mockedIShipyardRetriever in code that requires shipyardretriever.IShipyardRetriever
	// and then make assertions.

}

func (*IShipyardRetrieverMock) GetCachedShipyard

func (mock *IShipyardRetrieverMock) GetCachedShipyard(projectName string) (*keptnv2.Shipyard, error)

GetCachedShipyard calls GetCachedShipyardFunc.

func (*IShipyardRetrieverMock) GetCachedShipyardCalls

func (mock *IShipyardRetrieverMock) GetCachedShipyardCalls() []struct {
	ProjectName string
}

GetCachedShipyardCalls gets all the calls that were made to GetCachedShipyard. Check the length with:

len(mockedIShipyardRetriever.GetCachedShipyardCalls())

func (*IShipyardRetrieverMock) GetLatestCommitID

func (mock *IShipyardRetrieverMock) GetLatestCommitID(projectName string, stageName string) (string, error)

GetLatestCommitID calls GetLatestCommitIDFunc.

func (*IShipyardRetrieverMock) GetLatestCommitIDCalls

func (mock *IShipyardRetrieverMock) GetLatestCommitIDCalls() []struct {
	ProjectName string
	StageName   string
}

GetLatestCommitIDCalls gets all the calls that were made to GetLatestCommitID. Check the length with:

len(mockedIShipyardRetriever.GetLatestCommitIDCalls())

func (*IShipyardRetrieverMock) GetShipyard

func (mock *IShipyardRetrieverMock) GetShipyard(projectName string) (*keptnv2.Shipyard, error)

GetShipyard calls GetShipyardFunc.

func (*IShipyardRetrieverMock) GetShipyardCalls

func (mock *IShipyardRetrieverMock) GetShipyardCalls() []struct {
	ProjectName string
}

GetShipyardCalls gets all the calls that were made to GetShipyard. Check the length with:

len(mockedIShipyardRetriever.GetShipyardCalls())

Jump to

Keyboard shortcuts

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