IsType asserts that the specified objects are of the same type. assert.IsType(t, &MyStruct{}, &MyStruct{})
(t TestingT, expectedType, object interface{}, msgAndArgs ...interface{})
| 463 | // |
| 464 | // assert.IsType(t, &MyStruct{}, &MyStruct{}) |
| 465 | func IsType(t TestingT, expectedType, object interface{}, msgAndArgs ...interface{}) bool { |
| 466 | if isType(expectedType, object) { |
| 467 | return true |
| 468 | } |
| 469 | if h, ok := t.(tHelper); ok { |
| 470 | h.Helper() |
| 471 | } |
| 472 | return Fail(t, fmt.Sprintf("Object expected to be of type %T, but was %T", expectedType, object), msgAndArgs...) |
| 473 | } |
| 474 | |
| 475 | // IsNotType asserts that the specified objects are not of the same type. |
| 476 | // |