Documentation ¶
Index ¶
- type DataRepository
- func (repo *DataRepository) Expect(stm string, columns []string, numRecords int, args ...driver.Value)
- func (repo *DataRepository) ExpectWithRecords(stm string, recs *sqlmock.Rows, args ...driver.Value)
- func (repo *DataRepository) ExpectationsWereMet() error
- func (repo *DataRepository) GetWriterBuffer() []string
- type MockWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataRepository ¶
type DataRepository struct { DB *sql.DB Writer *bufio.Writer // contains filtered or unexported fields }
DataRepository encapsulates I/O operations.
func CreateDataRepository ¶
func CreateDataRepository() *DataRepository
CreateDataRepository factory method for the DataRepository
func (*DataRepository) Expect ¶
func (repo *DataRepository) Expect(stm string, columns []string, numRecords int, args ...driver.Value)
Expect adds data to repository, which can then be retrieved by the tested function.
func (*DataRepository) ExpectWithRecords ¶
func (repo *DataRepository) ExpectWithRecords(stm string, recs *sqlmock.Rows, args ...driver.Value)
ExpectInfoSchema adds data to repository, which can then be retrieved by the tested function.
func (*DataRepository) ExpectationsWereMet ¶
func (repo *DataRepository) ExpectationsWereMet() error
ExpectationsWereMet checks whether all queued expectations were met in order. If any of them was not met - an error is returned.
func (*DataRepository) GetWriterBuffer ¶
func (repo *DataRepository) GetWriterBuffer() []string
type MockWriter ¶
type MockWriter struct {
// contains filtered or unexported fields
}
MockWriter allows to create a mock bufferWriter object, as it implements the interface
func (*MockWriter) GetData ¶
func (mr *MockWriter) GetData() []string
Click to show internal directories.
Click to hide internal directories.