analyticstest

package
v1.94.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQSClientMock

type SQSClientMock struct {
	// SendMessageFunc mocks the SendMessage method.
	SendMessageFunc func(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error)
	// contains filtered or unexported fields
}

SQSClientMock is a mock implementation of analytics.SQSClient.

    func TestSomethingThatUsesSQSClient(t *testing.T) {

        // make and configure a mocked analytics.SQSClient
        mockedSQSClient := &SQSClientMock{
            SendMessageFunc: func(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error) {
	               panic("mock out the SendMessage method")
            },
        }

        // use mockedSQSClient in code that requires analytics.SQSClient
        // and then make assertions.

    }

func (*SQSClientMock) SendMessage

func (mock *SQSClientMock) SendMessage(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error)

SendMessage calls SendMessageFunc.

func (*SQSClientMock) SendMessageCalls

func (mock *SQSClientMock) SendMessageCalls() []struct {
	Ctx    context.Context
	Params *sqs.SendMessageInput
	OptFns []func(*sqs.Options)
}

SendMessageCalls gets all the calls that were made to SendMessage. Check the length with:

len(mockedSQSClient.SendMessageCalls())

Jump to

Keyboard shortcuts

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