Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { // consume message from broker within given topic // will loop forever Consume(topic string) }
Repository function contract for customer repo
type RepositoryMock ¶
type RepositoryMock struct { // ConsumeFunc mocks the Consume method. ConsumeFunc func(topic string) // contains filtered or unexported fields }
RepositoryMock is a mock implementation of Repository.
func TestSomethingThatUsesRepository(t *testing.T) { // make and configure a mocked Repository mockedRepository := &RepositoryMock{ ConsumeFunc: func(topic string) { panic("mock out the Consume method") }, } // use mockedRepository in code that requires Repository // and then make assertions. }
func (*RepositoryMock) Consume ¶
func (mock *RepositoryMock) Consume(topic string)
Consume calls ConsumeFunc.
func (*RepositoryMock) ConsumeCalls ¶
func (mock *RepositoryMock) ConsumeCalls() []struct { Topic string }
ConsumeCalls gets all the calls that were made to Consume. Check the length with:
len(mockedRepository.ConsumeCalls())
Click to show internal directories.
Click to hide internal directories.