Documentation
¶
Index ¶
- type RunnableRepoMock
- func (mock *RunnableRepoMock) DB() *sqlx.DB
- func (mock *RunnableRepoMock) DBCalls() []struct{}
- func (mock *RunnableRepoMock) Sample() repos.SampleRepo
- func (mock *RunnableRepoMock) SampleCalls() []struct{}
- func (mock *RunnableRepoMock) Start() error
- func (mock *RunnableRepoMock) StartCalls() []struct{}
- func (mock *RunnableRepoMock) Stop() error
- func (mock *RunnableRepoMock) StopCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunnableRepoMock ¶
type RunnableRepoMock struct {
// DBFunc mocks the DB method.
DBFunc func() *sqlx.DB
// SampleFunc mocks the Sample method.
SampleFunc func() repos.SampleRepo
// StartFunc mocks the Start method.
StartFunc func() error
// StopFunc mocks the Stop method.
StopFunc func() error
// contains filtered or unexported fields
}
RunnableRepoMock is a mock implementation of repos.RunnableRepo.
func TestSomethingThatUsesRunnableRepo(t *testing.T) {
// make and configure a mocked repos.RunnableRepo
mockedRunnableRepo := &RunnableRepoMock{
DBFunc: func() *sqlx.DB {
panic("mock out the DB method")
},
SampleFunc: func() repos.SampleRepo {
panic("mock out the Sample method")
},
StartFunc: func() error {
panic("mock out the Start method")
},
StopFunc: func() error {
panic("mock out the Stop method")
},
}
// use mockedRunnableRepo in code that requires repos.RunnableRepo
// and then make assertions.
}
func (*RunnableRepoMock) DBCalls ¶
func (mock *RunnableRepoMock) DBCalls() []struct { }
DBCalls gets all the calls that were made to DB. Check the length with:
len(mockedRunnableRepo.DBCalls())
func (*RunnableRepoMock) Sample ¶
func (mock *RunnableRepoMock) Sample() repos.SampleRepo
Sample calls SampleFunc.
func (*RunnableRepoMock) SampleCalls ¶
func (mock *RunnableRepoMock) SampleCalls() []struct { }
SampleCalls gets all the calls that were made to Sample. Check the length with:
len(mockedRunnableRepo.SampleCalls())
func (*RunnableRepoMock) StartCalls ¶
func (mock *RunnableRepoMock) StartCalls() []struct { }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedRunnableRepo.StartCalls())
func (*RunnableRepoMock) StopCalls ¶
func (mock *RunnableRepoMock) StopCalls() []struct { }
StopCalls gets all the calls that were made to Stop. Check the length with:
len(mockedRunnableRepo.StopCalls())
Click to show internal directories.
Click to hide internal directories.