// Code generated by mockery. DO NOT EDIT.

package mock_common

import (
	context "context"

	editorsmartblock "github.com/anyproto/anytype-heart/core/block/editor/smartblock"
	mock "github.com/stretchr/testify/mock"

	smartblock "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock"
)

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

type MockObjectTreeCreator_Expecter struct {
	mock *mock.Mock
}

func (_m *MockObjectTreeCreator) EXPECT() *MockObjectTreeCreator_Expecter {
	return &MockObjectTreeCreator_Expecter{mock: &_m.Mock}
}

// CreateTreeObject provides a mock function with given fields: ctx, tp, initFunc
func (_m *MockObjectTreeCreator) CreateTreeObject(ctx context.Context, tp smartblock.SmartBlockType, initFunc func(string) *editorsmartblock.InitContext) (editorsmartblock.SmartBlock, func(), error) {
	ret := _m.Called(ctx, tp, initFunc)

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

	var r0 editorsmartblock.SmartBlock
	var r1 func()
	var r2 error
	if rf, ok := ret.Get(0).(func(context.Context, smartblock.SmartBlockType, func(string) *editorsmartblock.InitContext) (editorsmartblock.SmartBlock, func(), error)); ok {
		return rf(ctx, tp, initFunc)
	}
	if rf, ok := ret.Get(0).(func(context.Context, smartblock.SmartBlockType, func(string) *editorsmartblock.InitContext) editorsmartblock.SmartBlock); ok {
		r0 = rf(ctx, tp, initFunc)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(editorsmartblock.SmartBlock)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, smartblock.SmartBlockType, func(string) *editorsmartblock.InitContext) func()); ok {
		r1 = rf(ctx, tp, initFunc)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).(func())
		}
	}

	if rf, ok := ret.Get(2).(func(context.Context, smartblock.SmartBlockType, func(string) *editorsmartblock.InitContext) error); ok {
		r2 = rf(ctx, tp, initFunc)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

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

// CreateTreeObject is a helper method to define mock.On call
//   - ctx context.Context
//   - tp smartblock.SmartBlockType
//   - initFunc func(string) *editorsmartblock.InitContext
func (_e *MockObjectTreeCreator_Expecter) CreateTreeObject(ctx interface{}, tp interface{}, initFunc interface{}) *MockObjectTreeCreator_CreateTreeObject_Call {
	return &MockObjectTreeCreator_CreateTreeObject_Call{Call: _e.mock.On("CreateTreeObject", ctx, tp, initFunc)}
}

func (_c *MockObjectTreeCreator_CreateTreeObject_Call) Run(run func(ctx context.Context, tp smartblock.SmartBlockType, initFunc func(string) *editorsmartblock.InitContext)) *MockObjectTreeCreator_CreateTreeObject_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(smartblock.SmartBlockType), args[2].(func(string) *editorsmartblock.InitContext))
	})
	return _c
}

func (_c *MockObjectTreeCreator_CreateTreeObject_Call) Return(sb editorsmartblock.SmartBlock, release func(), err error) *MockObjectTreeCreator_CreateTreeObject_Call {
	_c.Call.Return(sb, release, err)
	return _c
}

func (_c *MockObjectTreeCreator_CreateTreeObject_Call) RunAndReturn(run func(context.Context, smartblock.SmartBlockType, func(string) *editorsmartblock.InitContext) (editorsmartblock.SmartBlock, func(), error)) *MockObjectTreeCreator_CreateTreeObject_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
