// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package mock

import (
	"sync"
)

// ControllableMock is a mock implementation of types.Controllable.
//
//	func TestSomethingThatUsesControllable(t *testing.T) {
//
//		// make and configure a mocked types.Controllable
//		mockedControllable := &ControllableMock{
//			FinalizeFunc: func()  {
//				panic("mock out the Finalize method")
//			},
//			RegistryKeyFunc: func() K {
//				panic("mock out the RegistryKey method")
//			},
//			RevertToSnapshotFunc: func(n int)  {
//				panic("mock out the RevertToSnapshot method")
//			},
//			SnapshotFunc: func() int {
//				panic("mock out the Snapshot method")
//			},
//		}
//
//		// use mockedControllable in code that requires types.Controllable
//		// and then make assertions.
//
//	}
type ControllableMock[K comparable] struct {
	// FinalizeFunc mocks the Finalize method.
	FinalizeFunc func()

	// RegistryKeyFunc mocks the RegistryKey method.
	RegistryKeyFunc func() K

	// RevertToSnapshotFunc mocks the RevertToSnapshot method.
	RevertToSnapshotFunc func(n int)

	// SnapshotFunc mocks the Snapshot method.
	SnapshotFunc func() int

	// calls tracks calls to the methods.
	calls struct {
		// Finalize holds details about calls to the Finalize method.
		Finalize []struct {
		}
		// RegistryKey holds details about calls to the RegistryKey method.
		RegistryKey []struct {
		}
		// RevertToSnapshot holds details about calls to the RevertToSnapshot method.
		RevertToSnapshot []struct {
			// N is the n argument value.
			N int
		}
		// Snapshot holds details about calls to the Snapshot method.
		Snapshot []struct {
		}
	}
	lockFinalize         sync.RWMutex
	lockRegistryKey      sync.RWMutex
	lockRevertToSnapshot sync.RWMutex
	lockSnapshot         sync.RWMutex
}

// Finalize calls FinalizeFunc.
func (mock *ControllableMock[K]) Finalize() {
	if mock.FinalizeFunc == nil {
		panic("ControllableMock.FinalizeFunc: method is nil but Controllable.Finalize was just called")
	}
	callInfo := struct {
	}{}
	mock.lockFinalize.Lock()
	mock.calls.Finalize = append(mock.calls.Finalize, callInfo)
	mock.lockFinalize.Unlock()
	mock.FinalizeFunc()
}

// FinalizeCalls gets all the calls that were made to Finalize.
// Check the length with:
//
//	len(mockedControllable.FinalizeCalls())
func (mock *ControllableMock[K]) FinalizeCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockFinalize.RLock()
	calls = mock.calls.Finalize
	mock.lockFinalize.RUnlock()
	return calls
}

// RegistryKey calls RegistryKeyFunc.
func (mock *ControllableMock[K]) RegistryKey() K {
	if mock.RegistryKeyFunc == nil {
		panic("ControllableMock.RegistryKeyFunc: method is nil but Controllable.RegistryKey was just called")
	}
	callInfo := struct {
	}{}
	mock.lockRegistryKey.Lock()
	mock.calls.RegistryKey = append(mock.calls.RegistryKey, callInfo)
	mock.lockRegistryKey.Unlock()
	return mock.RegistryKeyFunc()
}

// RegistryKeyCalls gets all the calls that were made to RegistryKey.
// Check the length with:
//
//	len(mockedControllable.RegistryKeyCalls())
func (mock *ControllableMock[K]) RegistryKeyCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockRegistryKey.RLock()
	calls = mock.calls.RegistryKey
	mock.lockRegistryKey.RUnlock()
	return calls
}

// RevertToSnapshot calls RevertToSnapshotFunc.
func (mock *ControllableMock[K]) RevertToSnapshot(n int) {
	if mock.RevertToSnapshotFunc == nil {
		panic("ControllableMock.RevertToSnapshotFunc: method is nil but Controllable.RevertToSnapshot was just called")
	}
	callInfo := struct {
		N int
	}{
		N: n,
	}
	mock.lockRevertToSnapshot.Lock()
	mock.calls.RevertToSnapshot = append(mock.calls.RevertToSnapshot, callInfo)
	mock.lockRevertToSnapshot.Unlock()
	mock.RevertToSnapshotFunc(n)
}

// RevertToSnapshotCalls gets all the calls that were made to RevertToSnapshot.
// Check the length with:
//
//	len(mockedControllable.RevertToSnapshotCalls())
func (mock *ControllableMock[K]) RevertToSnapshotCalls() []struct {
	N int
} {
	var calls []struct {
		N int
	}
	mock.lockRevertToSnapshot.RLock()
	calls = mock.calls.RevertToSnapshot
	mock.lockRevertToSnapshot.RUnlock()
	return calls
}

// Snapshot calls SnapshotFunc.
func (mock *ControllableMock[K]) Snapshot() int {
	if mock.SnapshotFunc == nil {
		panic("ControllableMock.SnapshotFunc: method is nil but Controllable.Snapshot was just called")
	}
	callInfo := struct {
	}{}
	mock.lockSnapshot.Lock()
	mock.calls.Snapshot = append(mock.calls.Snapshot, callInfo)
	mock.lockSnapshot.Unlock()
	return mock.SnapshotFunc()
}

// SnapshotCalls gets all the calls that were made to Snapshot.
// Check the length with:
//
//	len(mockedControllable.SnapshotCalls())
func (mock *ControllableMock[K]) SnapshotCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockSnapshot.RLock()
	calls = mock.calls.Snapshot
	mock.lockSnapshot.RUnlock()
	return calls
}
