AssertExpectationsForObjects asserts that everything specified with On and Return of the specified objects was in fact called as expected. Calls may have occurred in any order.
(t TestingT, testObjects ...interface{})
| 600 | // |
| 601 | // Calls may have occurred in any order. |
| 602 | func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { |
| 603 | if h, ok := t.(tHelper); ok { |
| 604 | h.Helper() |
| 605 | } |
| 606 | for _, obj := range testObjects { |
| 607 | if m, ok := obj.(*Mock); ok { |
| 608 | t.Logf("Deprecated mock.AssertExpectationsForObjects(myMock.Mock) use mock.AssertExpectationsForObjects(myMock)") |
| 609 | obj = m |
| 610 | } |
| 611 | m := obj.(assertExpectationiser) |
| 612 | if !m.AssertExpectations(t) { |
| 613 | t.Logf("Expectations didn't match for Mock: %+v", reflect.TypeOf(m)) |
| 614 | return false |
| 615 | } |
| 616 | } |
| 617 | return true |
| 618 | } |
| 619 | |
| 620 | // AssertExpectations asserts that everything specified with On and Return was |
| 621 | // in fact called as expected. Calls may have occurred in any order. |