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

package mock

import (
	"github.com/axelarnetwork/axelar-core/utils/grpc"
	grpc2 "google.golang.org/grpc"
	"sync"
)

// Ensure, that ServerMock does implement grpc.Server.
// If this is not the case, regenerate this file with moq.
var _ grpc.Server = &ServerMock{}

// ServerMock is a mock implementation of grpc.Server.
//
//	func TestSomethingThatUsesServer(t *testing.T) {
//
//		// make and configure a mocked grpc.Server
//		mockedServer := &ServerMock{
//			RegisterServiceFunc: func(sd *grpc2.ServiceDesc, ss interface{})  {
//				panic("mock out the RegisterService method")
//			},
//		}
//
//		// use mockedServer in code that requires grpc.Server
//		// and then make assertions.
//
//	}
type ServerMock struct {
	// RegisterServiceFunc mocks the RegisterService method.
	RegisterServiceFunc func(sd *grpc2.ServiceDesc, ss interface{})

	// calls tracks calls to the methods.
	calls struct {
		// RegisterService holds details about calls to the RegisterService method.
		RegisterService []struct {
			// Sd is the sd argument value.
			Sd *grpc2.ServiceDesc
			// Ss is the ss argument value.
			Ss interface{}
		}
	}
	lockRegisterService sync.RWMutex
}

// RegisterService calls RegisterServiceFunc.
func (mock *ServerMock) RegisterService(sd *grpc2.ServiceDesc, ss interface{}) {
	if mock.RegisterServiceFunc == nil {
		panic("ServerMock.RegisterServiceFunc: method is nil but Server.RegisterService was just called")
	}
	callInfo := struct {
		Sd *grpc2.ServiceDesc
		Ss interface{}
	}{
		Sd: sd,
		Ss: ss,
	}
	mock.lockRegisterService.Lock()
	mock.calls.RegisterService = append(mock.calls.RegisterService, callInfo)
	mock.lockRegisterService.Unlock()
	mock.RegisterServiceFunc(sd, ss)
}

// RegisterServiceCalls gets all the calls that were made to RegisterService.
// Check the length with:
//
//	len(mockedServer.RegisterServiceCalls())
func (mock *ServerMock) RegisterServiceCalls() []struct {
	Sd *grpc2.ServiceDesc
	Ss interface{}
} {
	var calls []struct {
		Sd *grpc2.ServiceDesc
		Ss interface{}
	}
	mock.lockRegisterService.RLock()
	calls = mock.calls.RegisterService
	mock.lockRegisterService.RUnlock()
	return calls
}
