aboutsummaryrefslogtreecommitdiffstats
path: root/internal/bolttest/mock_sql_db.go
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2024-03-09 16:15:34 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2024-03-09 16:15:34 -0500
commit8c4a085cc27eca9966e6f37393c8053fef0c8a1c (patch)
treef7b6a45d341e8f503b4338b4ff580a56eb3af872 /internal/bolttest/mock_sql_db.go
parentUse actions/checkout@v4 (diff)
downloadcli-8c4a085cc27eca9966e6f37393c8053fef0c8a1c.zip
Cleanup tests
Diffstat (limited to 'internal/bolttest/mock_sql_db.go')
-rw-r--r--internal/bolttest/mock_sql_db.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/internal/bolttest/mock_sql_db.go b/internal/bolttest/mock_sql_db.go
deleted file mode 100644
index 0c12592..0000000
--- a/internal/bolttest/mock_sql_db.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package bolttest
-
-import "database/sql"
-
-type MockSqlDb struct {
- ExecReturnValue ExecReturnValue
- ExecCallCount int
- QueryReturnValue QueryReturnValue
- QueryCallCount int
- QueryRowReturnValue QueryRowReturnValue
- QueryRowCallCount int
- BeginReturnValue BeginReturnValue
- BeginCallCount int
-}
-
-type ExecReturnValue struct {
- Result sql.Result
- Err error
-}
-
-type QueryReturnValue struct {
- Rows *sql.Rows
- Err error
-}
-
-type QueryRowReturnValue struct {
- Row *sql.Row
-}
-
-type BeginReturnValue struct {
- Tx *sql.Tx
- Err error
-}
-
-func (db *MockSqlDb) Exec(query string, args ...any) (sql.Result, error) {
- db.ExecCallCount += 1
- return db.ExecReturnValue.Result, db.ExecReturnValue.Err
-}
-
-func (db *MockSqlDb) Query(query string, args ...any) (*sql.Rows, error) {
- db.QueryCallCount += 1
- return db.QueryReturnValue.Rows, db.QueryReturnValue.Err
-}
-
-func (db *MockSqlDb) QueryRow(query string, args ...any) *sql.Row {
- db.QueryRowCallCount += 1
- return db.QueryRowReturnValue.Row
-}
-
-func (db *MockSqlDb) Begin() (*sql.Tx, error) {
- db.BeginCallCount += 1
- return db.BeginReturnValue.Tx, db.BeginReturnValue.Err
-}