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

Method methodWasCalled

mock/mock.go:754–769  ·  view source on GitHub ↗
(methodName string, expected []interface{})

Source from the content-addressed store, hash-verified

752}
753
754func (m *Mock) methodWasCalled(methodName string, expected []interface{}) bool {
755 for _, call := range m.calls() {
756 if call.Method == methodName {
757
758 _, differences := Arguments(expected).Diff(call.Arguments)
759
760 if differences == 0 {
761 // found the expected call
762 return true
763 }
764
765 }
766 }
767 // we didn't find the expected call
768 return false
769}
770
771func (m *Mock) expectedCalls() []*Call {
772 return append([]*Call{}, m.ExpectedCalls...)

Callers 3

checkExpectationMethod · 0.95
AssertCalledMethod · 0.95
AssertNotCalledMethod · 0.95

Calls 3

callsMethod · 0.95
ArgumentsTypeAlias · 0.85
DiffMethod · 0.80

Tested by

no test coverage detected