Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandlerMock ¶
type EventHandlerMock struct {
// FiringFunc mocks the Firing method.
FiringFunc func(p *project.Project, events map[string]cue.Value) bool
// contains filtered or unexported fields
}
EventHandlerMock is a mock implementation of events.EventHandler.
func TestSomethingThatUsesEventHandler(t *testing.T) {
// make and configure a mocked events.EventHandler
mockedEventHandler := &EventHandlerMock{
FiringFunc: func(p *project.Project, events map[string]cue.Value) bool {
panic("mock out the Firing method")
},
}
// use mockedEventHandler in code that requires events.EventHandler
// and then make assertions.
}
func (*EventHandlerMock) FiringCalls ¶
func (mock *EventHandlerMock) FiringCalls() []struct { P *project.Project Events map[string]cue.Value }
FiringCalls gets all the calls that were made to Firing. Check the length with:
len(mockedEventHandler.FiringCalls())
Click to show internal directories.
Click to hide internal directories.