Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockEvent ¶
type MockEvent struct { // EmitFunc mocks the Emit method. EmitFunc func(phase apicommon.KeptnPhaseType, eventType string, reconcileObject client.Object, status string, message string, version string) // contains filtered or unexported fields }
MockEvent is a mock implementation of eventsender.IEvent.
func TestSomethingThatUsesIEvent(t *testing.T) { // make and configure a mocked eventsender.IEvent mockedIEvent := &MockEvent{ EmitFunc: func(phase apicommon.KeptnPhaseType, eventType string, reconcileObject client.Object, status string, message string, version string) { panic("mock out the Emit method") }, } // use mockedIEvent in code that requires eventsender.IEvent // and then make assertions. }
func (*MockEvent) Emit ¶
func (mock *MockEvent) Emit(phase apicommon.KeptnPhaseType, eventType string, reconcileObject client.Object, status string, message string, version string)
Emit calls EmitFunc.
func (*MockEvent) EmitCalls ¶
func (mock *MockEvent) EmitCalls() []struct { Phase apicommon.KeptnPhaseType EventType string ReconcileObject client.Object Status string Message string Version string }
EmitCalls gets all the calls that were made to Emit. Check the length with:
len(mockedIEvent.EmitCalls())
Click to show internal directories.
Click to hide internal directories.