gen

package
v0.0.0-...-44bd235 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 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 ISlackClientMock

type ISlackClientMock struct {
	// PostMessageFunc mocks the PostMessage method.
	PostMessageFunc func(s string, msgOptions ...slack.MsgOption) (string, string, error)
	// contains filtered or unexported fields
}

ISlackClientMock is a mock implementation of repositories.ISlackClient.

func TestSomethingThatUsesISlackClient(t *testing.T) {

	// make and configure a mocked repositories.ISlackClient
	mockedISlackClient := &ISlackClientMock{
		PostMessageFunc: func(s string, msgOptions ...slack.MsgOption) (string, string, error) {
			panic("mock out the PostMessage method")
		},
	}

	// use mockedISlackClient in code that requires repositories.ISlackClient
	// and then make assertions.

}

func (*ISlackClientMock) PostMessage

func (mock *ISlackClientMock) PostMessage(s string, msgOptions ...slack.MsgOption) (string, string, error)

PostMessage calls PostMessageFunc.

func (*ISlackClientMock) PostMessageCalls

func (mock *ISlackClientMock) PostMessageCalls() []struct {
	S          string
	MsgOptions []slack.MsgOption
}

PostMessageCalls gets all the calls that were made to PostMessage. Check the length with:

len(mockedISlackClient.PostMessageCalls())

Jump to

Keyboard shortcuts

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