// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package modelmock

import (
	"database/sql"

	mock "github.com/stretchr/testify/mock"
)

// NewDBInterfaceMock creates a new instance of DBInterfaceMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewDBInterfaceMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *DBInterfaceMock {
	mock := &DBInterfaceMock{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// DBInterfaceMock is an autogenerated mock type for the DBInterface type
type DBInterfaceMock struct {
	mock.Mock
}

type DBInterfaceMock_Expecter struct {
	mock *mock.Mock
}

func (_m *DBInterfaceMock) EXPECT() *DBInterfaceMock_Expecter {
	return &DBInterfaceMock_Expecter{mock: &_m.Mock}
}

// Begin provides a mock function for the type DBInterfaceMock
func (_mock *DBInterfaceMock) Begin() (*sql.Tx, error) {
	ret := _mock.Called()

	if len(ret) == 0 {
		panic("no return value specified for Begin")
	}

	var r0 *sql.Tx
	var r1 error
	if returnFunc, ok := ret.Get(0).(func() (*sql.Tx, error)); ok {
		return returnFunc()
	}
	if returnFunc, ok := ret.Get(0).(func() *sql.Tx); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Tx)
		}
	}
	if returnFunc, ok := ret.Get(1).(func() error); ok {
		r1 = returnFunc()
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// DBInterfaceMock_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin'
type DBInterfaceMock_Begin_Call struct {
	*mock.Call
}

// Begin is a helper method to define mock.On call
func (_e *DBInterfaceMock_Expecter) Begin() *DBInterfaceMock_Begin_Call {
	return &DBInterfaceMock_Begin_Call{Call: _e.mock.On("Begin")}
}

func (_c *DBInterfaceMock_Begin_Call) Run(run func()) *DBInterfaceMock_Begin_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *DBInterfaceMock_Begin_Call) Return(tx *sql.Tx, err error) *DBInterfaceMock_Begin_Call {
	_c.Call.Return(tx, err)
	return _c
}

func (_c *DBInterfaceMock_Begin_Call) RunAndReturn(run func() (*sql.Tx, error)) *DBInterfaceMock_Begin_Call {
	_c.Call.Return(run)
	return _c
}

// Close provides a mock function for the type DBInterfaceMock
func (_mock *DBInterfaceMock) Close() error {
	ret := _mock.Called()

	if len(ret) == 0 {
		panic("no return value specified for Close")
	}

	var r0 error
	if returnFunc, ok := ret.Get(0).(func() error); ok {
		r0 = returnFunc()
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

// DBInterfaceMock_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type DBInterfaceMock_Close_Call struct {
	*mock.Call
}

// Close is a helper method to define mock.On call
func (_e *DBInterfaceMock_Expecter) Close() *DBInterfaceMock_Close_Call {
	return &DBInterfaceMock_Close_Call{Call: _e.mock.On("Close")}
}

func (_c *DBInterfaceMock_Close_Call) Run(run func()) *DBInterfaceMock_Close_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *DBInterfaceMock_Close_Call) Return(err error) *DBInterfaceMock_Close_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *DBInterfaceMock_Close_Call) RunAndReturn(run func() error) *DBInterfaceMock_Close_Call {
	_c.Call.Return(run)
	return _c
}

// Exec provides a mock function for the type DBInterfaceMock
func (_mock *DBInterfaceMock) Exec(query string, args ...any) (sql.Result, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _mock.Called(_ca...)

	if len(ret) == 0 {
		panic("no return value specified for Exec")
	}

	var r0 sql.Result
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(string, ...any) (sql.Result, error)); ok {
		return returnFunc(query, args...)
	}
	if returnFunc, ok := ret.Get(0).(func(string, ...any) sql.Result); ok {
		r0 = returnFunc(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(sql.Result)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(string, ...any) error); ok {
		r1 = returnFunc(query, args...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// DBInterfaceMock_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec'
type DBInterfaceMock_Exec_Call struct {
	*mock.Call
}

// Exec is a helper method to define mock.On call
//   - query string
//   - args ...any
func (_e *DBInterfaceMock_Expecter) Exec(query interface{}, args ...interface{}) *DBInterfaceMock_Exec_Call {
	return &DBInterfaceMock_Exec_Call{Call: _e.mock.On("Exec",
		append([]interface{}{query}, args...)...)}
}

func (_c *DBInterfaceMock_Exec_Call) Run(run func(query string, args ...any)) *DBInterfaceMock_Exec_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		var arg1 []any
		variadicArgs := make([]any, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(any)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

func (_c *DBInterfaceMock_Exec_Call) Return(result sql.Result, err error) *DBInterfaceMock_Exec_Call {
	_c.Call.Return(result, err)
	return _c
}

func (_c *DBInterfaceMock_Exec_Call) RunAndReturn(run func(query string, args ...any) (sql.Result, error)) *DBInterfaceMock_Exec_Call {
	_c.Call.Return(run)
	return _c
}

// Query provides a mock function for the type DBInterfaceMock
func (_mock *DBInterfaceMock) Query(query string, args ...any) (*sql.Rows, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _mock.Called(_ca...)

	if len(ret) == 0 {
		panic("no return value specified for Query")
	}

	var r0 *sql.Rows
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(string, ...any) (*sql.Rows, error)); ok {
		return returnFunc(query, args...)
	}
	if returnFunc, ok := ret.Get(0).(func(string, ...any) *sql.Rows); ok {
		r0 = returnFunc(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Rows)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(string, ...any) error); ok {
		r1 = returnFunc(query, args...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// DBInterfaceMock_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
type DBInterfaceMock_Query_Call struct {
	*mock.Call
}

// Query is a helper method to define mock.On call
//   - query string
//   - args ...any
func (_e *DBInterfaceMock_Expecter) Query(query interface{}, args ...interface{}) *DBInterfaceMock_Query_Call {
	return &DBInterfaceMock_Query_Call{Call: _e.mock.On("Query",
		append([]interface{}{query}, args...)...)}
}

func (_c *DBInterfaceMock_Query_Call) Run(run func(query string, args ...any)) *DBInterfaceMock_Query_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 string
		if args[0] != nil {
			arg0 = args[0].(string)
		}
		var arg1 []any
		variadicArgs := make([]any, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(any)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

func (_c *DBInterfaceMock_Query_Call) Return(rows *sql.Rows, err error) *DBInterfaceMock_Query_Call {
	_c.Call.Return(rows, err)
	return _c
}

func (_c *DBInterfaceMock_Query_Call) RunAndReturn(run func(query string, args ...any) (*sql.Rows, error)) *DBInterfaceMock_Query_Call {
	_c.Call.Return(run)
	return _c
}
