Documentation
¶
Index ¶
- type IfaceMock
- func (mock *IfaceMock) App() chi.Router
- func (mock *IfaceMock) AppCalls() []struct{}
- func (mock *IfaceMock) Config() *viper.Viper
- func (mock *IfaceMock) ConfigCalls() []struct{}
- func (mock *IfaceMock) DB() *sqlx.DB
- func (mock *IfaceMock) DBCalls() []struct{}
- func (mock *IfaceMock) Logger() log.Factory
- func (mock *IfaceMock) LoggerCalls() []struct{}
- func (mock *IfaceMock) Repos() repos.Iface
- func (mock *IfaceMock) ReposCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IfaceMock ¶
type IfaceMock struct {
// AppFunc mocks the App method.
AppFunc func() chi.Router
// ConfigFunc mocks the Config method.
ConfigFunc func() *viper.Viper
// DBFunc mocks the DB method.
DBFunc func() *sqlx.DB
// LoggerFunc mocks the Logger method.
LoggerFunc func() log.Factory
// ReposFunc mocks the Repos method.
ReposFunc func() repos.Iface
// contains filtered or unexported fields
}
IfaceMock is a mock implementation of injected.Iface.
func TestSomethingThatUsesIface(t *testing.T) {
// make and configure a mocked injected.Iface
mockedIface := &IfaceMock{
AppFunc: func() chi.Router {
panic("mock out the App method")
},
ConfigFunc: func() *viper.Viper {
panic("mock out the Config method")
},
DBFunc: func() *sqlx.DB {
panic("mock out the DB method")
},
LoggerFunc: func() log.Factory {
panic("mock out the Logger method")
},
ReposFunc: func() repos.Iface {
panic("mock out the Repos method")
},
}
// use mockedIface in code that requires injected.Iface
// and then make assertions.
}
func (*IfaceMock) AppCalls ¶
func (mock *IfaceMock) AppCalls() []struct { }
AppCalls gets all the calls that were made to App. Check the length with:
len(mockedIface.AppCalls())
func (*IfaceMock) ConfigCalls ¶
func (mock *IfaceMock) ConfigCalls() []struct { }
ConfigCalls gets all the calls that were made to Config. Check the length with:
len(mockedIface.ConfigCalls())
func (*IfaceMock) DBCalls ¶
func (mock *IfaceMock) DBCalls() []struct { }
DBCalls gets all the calls that were made to DB. Check the length with:
len(mockedIface.DBCalls())
func (*IfaceMock) LoggerCalls ¶
func (mock *IfaceMock) LoggerCalls() []struct { }
LoggerCalls gets all the calls that were made to Logger. Check the length with:
len(mockedIface.LoggerCalls())
func (*IfaceMock) ReposCalls ¶
func (mock *IfaceMock) ReposCalls() []struct { }
ReposCalls gets all the calls that were made to Repos. Check the length with:
len(mockedIface.ReposCalls())
Click to show internal directories.
Click to hide internal directories.