// Code generated by mockery v2.13.0-beta.1. DO NOT EDIT.

package storage

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

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

// Close provides a mock function with given fields:
func (_m *RepositoryMock) Close() error {
	ret := _m.Called()

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

	return r0
}

// Create provides a mock function with given fields: key, model
func (_m *RepositoryMock) Create(key []byte, model Model) error {
	ret := _m.Called(key, model)

	var r0 error
	if rf, ok := ret.Get(0).(func([]byte, Model) error); ok {
		r0 = rf(key, model)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Delete provides a mock function with given fields: key
func (_m *RepositoryMock) Delete(key []byte) error {
	ret := _m.Called(key)

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

	return r0
}

// Exists provides a mock function with given fields: key
func (_m *RepositoryMock) Exists(key []byte) bool {
	ret := _m.Called(key)

	var r0 bool
	if rf, ok := ret.Get(0).(func([]byte) bool); ok {
		r0 = rf(key)
	} else {
		r0 = ret.Get(0).(bool)
	}

	return r0
}

// Get provides a mock function with given fields: key
func (_m *RepositoryMock) Get(key []byte) (Model, error) {
	ret := _m.Called(key)

	var r0 Model
	if rf, ok := ret.Get(0).(func([]byte) Model); ok {
		r0 = rf(key)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(Model)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(key)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GetAllByPrefix provides a mock function with given fields: prefix
func (_m *RepositoryMock) GetAllByPrefix(prefix string) ([]Model, error) {
	ret := _m.Called(prefix)

	var r0 []Model
	if rf, ok := ret.Get(0).(func(string) []Model); ok {
		r0 = rf(prefix)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]Model)
		}
	}

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

	return r0, r1
}

// Register provides a mock function with given fields: model
func (_m *RepositoryMock) Register(model Model) {
	_m.Called(model)
}

// Update provides a mock function with given fields: key, model
func (_m *RepositoryMock) Update(key []byte, model Model) error {
	ret := _m.Called(key, model)

	var r0 error
	if rf, ok := ret.Get(0).(func([]byte, Model) error); ok {
		r0 = rf(key, model)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

type NewRepositoryMockT interface {
	mock.TestingT
	Cleanup(func())
}

// NewRepositoryMock creates a new instance of RepositoryMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewRepositoryMock(t NewRepositoryMockT) *RepositoryMock {
	mock := &RepositoryMock{}
	mock.Mock.Test(t)

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

	return mock
}
