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

package mocks

import (
	mock "github.com/stretchr/testify/mock"
	"go.woodpecker-ci.org/woodpecker/v3/server/model"
)

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

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

	return mock
}

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

type MockService_Expecter struct {
	mock *mock.Mock
}

func (_m *MockService) EXPECT() *MockService_Expecter {
	return &MockService_Expecter{mock: &_m.Mock}
}

// EnvironList provides a mock function for the type MockService
func (_mock *MockService) EnvironList(repo *model.Repo) ([]*model.Environ, error) {
	ret := _mock.Called(repo)

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

	var r0 []*model.Environ
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(*model.Repo) ([]*model.Environ, error)); ok {
		return returnFunc(repo)
	}
	if returnFunc, ok := ret.Get(0).(func(*model.Repo) []*model.Environ); ok {
		r0 = returnFunc(repo)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*model.Environ)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(*model.Repo) error); ok {
		r1 = returnFunc(repo)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// EnvironList is a helper method to define mock.On call
//   - repo *model.Repo
func (_e *MockService_Expecter) EnvironList(repo interface{}) *MockService_EnvironList_Call {
	return &MockService_EnvironList_Call{Call: _e.mock.On("EnvironList", repo)}
}

func (_c *MockService_EnvironList_Call) Run(run func(repo *model.Repo)) *MockService_EnvironList_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *model.Repo
		if args[0] != nil {
			arg0 = args[0].(*model.Repo)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *MockService_EnvironList_Call) Return(environs []*model.Environ, err error) *MockService_EnvironList_Call {
	_c.Call.Return(environs, err)
	return _c
}

func (_c *MockService_EnvironList_Call) RunAndReturn(run func(repo *model.Repo) ([]*model.Environ, error)) *MockService_EnvironList_Call {
	_c.Call.Return(run)
	return _c
}
