mocks

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailSenderMock

type EmailSenderMock struct {
	// GetDefaultFromNameFunc mocks the GetDefaultFromName method.
	GetDefaultFromNameFunc func() string

	// SendFunc mocks the Send method.
	SendFunc func(ctx context.Context, req email.Request) error
	// contains filtered or unexported fields
}

EmailSenderMock is a mock implementation of server.EmailSender.

func TestSomethingThatUsesEmailSender(t *testing.T) {

	// make and configure a mocked server.EmailSender
	mockedEmailSender := &EmailSenderMock{
		GetDefaultFromNameFunc: func() string {
			panic("mock out the GetDefaultFromName method")
		},
		SendFunc: func(ctx context.Context, req email.Request) error {
			panic("mock out the Send method")
		},
	}

	// use mockedEmailSender in code that requires server.EmailSender
	// and then make assertions.

}

func (*EmailSenderMock) GetDefaultFromName

func (mock *EmailSenderMock) GetDefaultFromName() string

GetDefaultFromName calls GetDefaultFromNameFunc.

func (*EmailSenderMock) GetDefaultFromNameCalls

func (mock *EmailSenderMock) GetDefaultFromNameCalls() []struct {
}

GetDefaultFromNameCalls gets all the calls that were made to GetDefaultFromName. Check the length with:

len(mockedEmailSender.GetDefaultFromNameCalls())

func (*EmailSenderMock) Send

func (mock *EmailSenderMock) Send(ctx context.Context, req email.Request) error

Send calls SendFunc.

func (*EmailSenderMock) SendCalls

func (mock *EmailSenderMock) SendCalls() []struct {
	Ctx context.Context
	Req email.Request
}

SendCalls gets all the calls that were made to Send. Check the length with:

len(mockedEmailSender.SendCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL