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

package discord

import (
	"sync"

	"github.com/diamondburned/arikawa/discord"
)

// isessionMock is a mock implementation of isession.
//
// 	func TestSomethingThatUsesisession(t *testing.T) {
//
// 		// make and configure a mocked isession
// 		mockedisession := &isessionMock{
// 			SendMessageFunc: func(channelID discord.ChannelID, content string, embed *discord.Embed) (*discord.Message, error) {
// 				panic("mock out the SendMessage method")
// 			},
// 		}
//
// 		// use mockedisession in code that requires isession
// 		// and then make assertions.
//
// 	}
type isessionMock struct {
	// SendMessageFunc mocks the SendMessage method.
	SendMessageFunc func(channelID discord.ChannelID, content string, embed *discord.Embed) (*discord.Message, error)

	// calls tracks calls to the methods.
	calls struct {
		// SendMessage holds details about calls to the SendMessage method.
		SendMessage []struct {
			// ChannelID is the channelID argument value.
			ChannelID discord.ChannelID
			// Content is the content argument value.
			Content string
			// Embed is the embed argument value.
			Embed *discord.Embed
		}
	}
	lockSendMessage sync.RWMutex
}

// SendMessage calls SendMessageFunc.
func (mock *isessionMock) SendMessage(channelID discord.ChannelID, content string, embed *discord.Embed) (*discord.Message, error) {
	if mock.SendMessageFunc == nil {
		panic("isessionMock.SendMessageFunc: method is nil but isession.SendMessage was just called")
	}
	callInfo := struct {
		ChannelID discord.ChannelID
		Content   string
		Embed     *discord.Embed
	}{
		ChannelID: channelID,
		Content:   content,
		Embed:     embed,
	}
	mock.lockSendMessage.Lock()
	mock.calls.SendMessage = append(mock.calls.SendMessage, callInfo)
	mock.lockSendMessage.Unlock()
	return mock.SendMessageFunc(channelID, content, embed)
}

// SendMessageCalls gets all the calls that were made to SendMessage.
// Check the length with:
//     len(mockedisession.SendMessageCalls())
func (mock *isessionMock) SendMessageCalls() []struct {
	ChannelID discord.ChannelID
	Content   string
	Embed     *discord.Embed
} {
	var calls []struct {
		ChannelID discord.ChannelID
		Content   string
		Embed     *discord.Embed
	}
	mock.lockSendMessage.RLock()
	calls = mock.calls.SendMessage
	mock.lockSendMessage.RUnlock()
	return calls
}
