MCPcopy
hub / github.com/stretchr/testify / Times

Method Times

mock/mock.go:147–152  ·  view source on GitHub ↗

Times indicates that the mock should only return the indicated number of times. Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Times(5)

(i int)

Source from the content-addressed store, hash-verified

145//
146// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Times(5)
147func (c *Call) Times(i int) *Call {
148 c.lock()
149 defer c.unlock()
150 c.Repeatability = i
151 return c
152}
153
154// WaitUntil sets the channel that will block the mock's return until its closed
155// or a message is received.

Callers 5

OnceMethod · 0.95
TwiceMethod · 0.95
Test_Mock_Return_TimesFunction · 0.80

Calls 2

lockMethod · 0.95
unlockMethod · 0.95