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())
Click to show internal directories.
Click to hide internal directories.