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

package modelmock

import (
	"database/sql"

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

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

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

	return mock
}

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

type TxInterfaceMock_Expecter struct {
	mock *mock.Mock
}

func (_m *TxInterfaceMock) EXPECT() *TxInterfaceMock_Expecter {
	return &TxInterfaceMock_Expecter{mock: &_m.Mock}
}

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

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

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

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

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

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

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

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

// Exec provides a mock function for the type TxInterfaceMock
func (_mock *TxInterfaceMock) 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
}

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

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

func (_c *TxInterfaceMock_Exec_Call) Run(run func(query string, args ...any)) *TxInterfaceMock_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 *TxInterfaceMock_Exec_Call) Return(result sql.Result, err error) *TxInterfaceMock_Exec_Call {
	_c.Call.Return(result, err)
	return _c
}

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

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

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

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

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

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

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

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

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