Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RepeatForever, can be used with: // OnMock().Repeat(mocks.RepeatForever). RepeatForever int = -1 )
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call[T any] struct { // contains filtered or unexported fields }
type Config ¶
type Config interface { // Repeat sets how many times the function group should be called, note that if more than 1 function is given, // all the functions should repeat n times. // Repeat is 1 by default, meaning that functions can only be called 1 time. // Set Repeat(-1) to allow the group to repeat indefinitely. Repeat(times int) // Maybe sets the group as not required for AssertExpectations, // meaning that the function group will not fail the test if not called. Maybe() }
Config represents the configuration for all the functions passed to the On... function.
type Mock ¶
type Mock[T any] struct { // contains filtered or unexported fields }
func (*Mock[T]) Append ¶
func (c *Mock[T]) Append(f ...T) Config
Append creates a new card for the group of functions given, returning Config. With Config you can configure the group expectations.
func (*Mock[T]) AssertExpectations ¶
AssertExpectations asserts that all expected function calls have been called. Returns true if all expectations were met, otherwise returns false.
Click to show internal directories.
Click to hide internal directories.