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

Method findExpectedCall

mock/mock.go:388–404  ·  view source on GitHub ↗

* Recording and responding to activity */

(method string, arguments ...interface{})

Source from the content-addressed store, hash-verified

386// */
387
388func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, *Call) {
389 var expectedCall *Call
390
391 for i, call := range m.ExpectedCalls {
392 if call.Method == method {
393 _, diffCount := call.Arguments.Diff(arguments)
394 if diffCount == 0 {
395 expectedCall = call
396 if call.Repeatability > -1 {
397 return i, call
398 }
399 }
400 }
401 }
402
403 return -1, expectedCall
404}
405
406type matchCandidate struct {
407 call *Call

Calls 1

DiffMethod · 0.80