// Code generated by mockery. DO NOT EDIT.

package mocks

import (
	context "context"
	sql "database/sql"

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

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

type Txer_Expecter struct {
	mock *mock.Mock
}

func (_m *Txer) EXPECT() *Txer_Expecter {
	return &Txer_Expecter{mock: &_m.Mock}
}

// AddCommitCallback provides a mock function with given fields: cb
func (_m *Txer) AddCommitCallback(cb func()) {
	_m.Called(cb)
}

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

// AddCommitCallback is a helper method to define mock.On call
//   - cb func()
func (_e *Txer_Expecter) AddCommitCallback(cb interface{}) *Txer_AddCommitCallback_Call {
	return &Txer_AddCommitCallback_Call{Call: _e.mock.On("AddCommitCallback", cb)}
}

func (_c *Txer_AddCommitCallback_Call) Run(run func(cb func())) *Txer_AddCommitCallback_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(func()))
	})
	return _c
}

func (_c *Txer_AddCommitCallback_Call) Return() *Txer_AddCommitCallback_Call {
	_c.Call.Return()
	return _c
}

func (_c *Txer_AddCommitCallback_Call) RunAndReturn(run func(func())) *Txer_AddCommitCallback_Call {
	_c.Run(run)
	return _c
}

// AddRollbackCallback provides a mock function with given fields: cb
func (_m *Txer) AddRollbackCallback(cb func()) {
	_m.Called(cb)
}

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

// AddRollbackCallback is a helper method to define mock.On call
//   - cb func()
func (_e *Txer_Expecter) AddRollbackCallback(cb interface{}) *Txer_AddRollbackCallback_Call {
	return &Txer_AddRollbackCallback_Call{Call: _e.mock.On("AddRollbackCallback", cb)}
}

func (_c *Txer_AddRollbackCallback_Call) Run(run func(cb func())) *Txer_AddRollbackCallback_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(func()))
	})
	return _c
}

func (_c *Txer_AddRollbackCallback_Call) Return() *Txer_AddRollbackCallback_Call {
	_c.Call.Return()
	return _c
}

func (_c *Txer_AddRollbackCallback_Call) RunAndReturn(run func(func())) *Txer_AddRollbackCallback_Call {
	_c.Run(run)
	return _c
}

// Commit provides a mock function with no fields
func (_m *Txer) Commit() error {
	ret := _m.Called()

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

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

	return r0
}

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

// Commit is a helper method to define mock.On call
func (_e *Txer_Expecter) Commit() *Txer_Commit_Call {
	return &Txer_Commit_Call{Call: _e.mock.On("Commit")}
}

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

func (_c *Txer_Commit_Call) Return(_a0 error) *Txer_Commit_Call {
	_c.Call.Return(_a0)
	return _c
}

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

// Exec provides a mock function with given fields: query, args
func (_m *Txer) Exec(query string, args ...interface{}) (sql.Result, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

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

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

	if rf, ok := ret.Get(1).(func(string, ...interface{}) error); ok {
		r1 = rf(query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

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

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

func (_c *Txer_Exec_Call) Return(_a0 sql.Result, _a1 error) *Txer_Exec_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Txer_Exec_Call) RunAndReturn(run func(string, ...interface{}) (sql.Result, error)) *Txer_Exec_Call {
	_c.Call.Return(run)
	return _c
}

// Query provides a mock function with given fields: query, args
func (_m *Txer) Query(query string, args ...interface{}) (*sql.Rows, error) {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

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

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

	if rf, ok := ret.Get(1).(func(string, ...interface{}) error); ok {
		r1 = rf(query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

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

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

func (_c *Txer_Query_Call) Return(_a0 *sql.Rows, _a1 error) *Txer_Query_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Txer_Query_Call) RunAndReturn(run func(string, ...interface{}) (*sql.Rows, error)) *Txer_Query_Call {
	_c.Call.Return(run)
	return _c
}

// QueryContext provides a mock function with given fields: ctx, query, args
func (_m *Txer) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) {
	var _ca []interface{}
	_ca = append(_ca, ctx, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

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

	var r0 *sql.Rows
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (*sql.Rows, error)); ok {
		return rf(ctx, query, args...)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *sql.Rows); ok {
		r0 = rf(ctx, query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Rows)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok {
		r1 = rf(ctx, query, args...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

// QueryContext is a helper method to define mock.On call
//   - ctx context.Context
//   - query string
//   - args ...interface{}
func (_e *Txer_Expecter) QueryContext(ctx interface{}, query interface{}, args ...interface{}) *Txer_QueryContext_Call {
	return &Txer_QueryContext_Call{Call: _e.mock.On("QueryContext",
		append([]interface{}{ctx, query}, args...)...)}
}

func (_c *Txer_QueryContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *Txer_QueryContext_Call {
	_c.Call.Run(func(args mock.Arguments) {
		variadicArgs := make([]interface{}, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(interface{})
			}
		}
		run(args[0].(context.Context), args[1].(string), variadicArgs...)
	})
	return _c
}

func (_c *Txer_QueryContext_Call) Return(_a0 *sql.Rows, _a1 error) *Txer_QueryContext_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Txer_QueryContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (*sql.Rows, error)) *Txer_QueryContext_Call {
	_c.Call.Return(run)
	return _c
}

// QueryRow provides a mock function with given fields: query, args
func (_m *Txer) QueryRow(query string, args ...interface{}) *sql.Row {
	var _ca []interface{}
	_ca = append(_ca, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

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

	var r0 *sql.Row
	if rf, ok := ret.Get(0).(func(string, ...interface{}) *sql.Row); ok {
		r0 = rf(query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Row)
		}
	}

	return r0
}

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

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

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

func (_c *Txer_QueryRow_Call) Return(_a0 *sql.Row) *Txer_QueryRow_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Txer_QueryRow_Call) RunAndReturn(run func(string, ...interface{}) *sql.Row) *Txer_QueryRow_Call {
	_c.Call.Return(run)
	return _c
}

// QueryRowContext provides a mock function with given fields: ctx, query, args
func (_m *Txer) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
	var _ca []interface{}
	_ca = append(_ca, ctx, query)
	_ca = append(_ca, args...)
	ret := _m.Called(_ca...)

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

	var r0 *sql.Row
	if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *sql.Row); ok {
		r0 = rf(ctx, query, args...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*sql.Row)
		}
	}

	return r0
}

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

// QueryRowContext is a helper method to define mock.On call
//   - ctx context.Context
//   - query string
//   - args ...interface{}
func (_e *Txer_Expecter) QueryRowContext(ctx interface{}, query interface{}, args ...interface{}) *Txer_QueryRowContext_Call {
	return &Txer_QueryRowContext_Call{Call: _e.mock.On("QueryRowContext",
		append([]interface{}{ctx, query}, args...)...)}
}

func (_c *Txer_QueryRowContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *Txer_QueryRowContext_Call {
	_c.Call.Run(func(args mock.Arguments) {
		variadicArgs := make([]interface{}, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(interface{})
			}
		}
		run(args[0].(context.Context), args[1].(string), variadicArgs...)
	})
	return _c
}

func (_c *Txer_QueryRowContext_Call) Return(_a0 *sql.Row) *Txer_QueryRowContext_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Txer_QueryRowContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) *sql.Row) *Txer_QueryRowContext_Call {
	_c.Call.Return(run)
	return _c
}

// Rollback provides a mock function with no fields
func (_m *Txer) Rollback() error {
	ret := _m.Called()

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

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

	return r0
}

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

// Rollback is a helper method to define mock.On call
func (_e *Txer_Expecter) Rollback() *Txer_Rollback_Call {
	return &Txer_Rollback_Call{Call: _e.mock.On("Rollback")}
}

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

func (_c *Txer_Rollback_Call) Return(_a0 error) *Txer_Rollback_Call {
	_c.Call.Return(_a0)
	return _c
}

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

// NewTxer creates a new instance of Txer. 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 NewTxer(t interface {
	mock.TestingT
	Cleanup(func())
}) *Txer {
	mock := &Txer{}
	mock.Mock.Test(t)

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

	return mock
}
