AssertNotCalled asserts that the method was not called. It can produce a false result when an argument is a pointer type and the underlying value changed after calling the mocked method.
(t TestingT, methodName string, arguments ...interface{})
| 700 | // AssertNotCalled asserts that the method was not called. |
| 701 | // It can produce a false result when an argument is a pointer type and the underlying value changed after calling the mocked method. |
| 702 | func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...interface{}) bool { |
| 703 | if h, ok := t.(tHelper); ok { |
| 704 | h.Helper() |
| 705 | } |
| 706 | m.mutex.Lock() |
| 707 | defer m.mutex.Unlock() |
| 708 | if m.methodWasCalled(methodName, arguments) { |
| 709 | return assert.Fail(t, "Should not have called with given arguments", |
| 710 | fmt.Sprintf("Expected %q to not have been called with:\n%v\nbut actually it was.", methodName, arguments)) |
| 711 | } |
| 712 | return true |
| 713 | } |
| 714 | |
| 715 | // IsMethodCallable checking that the method can be called |
| 716 | // If the method was called more than `Repeatability` return false |