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

Function TestImplements

assert/assertions_test.go:530–544  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

528}
529
530func TestImplements(t *testing.T) {
531 t.Parallel()
532
533 mockT := new(testing.T)
534
535 if !Implements(mockT, (*AssertionTesterInterface)(nil), new(AssertionTesterConformingObject)) {
536 t.Error("Implements method should return true: AssertionTesterConformingObject implements AssertionTesterInterface")
537 }
538 if Implements(mockT, (*AssertionTesterInterface)(nil), new(AssertionTesterNonConformingObject)) {
539 t.Error("Implements method should return false: AssertionTesterNonConformingObject does not implements AssertionTesterInterface")
540 }
541 if Implements(mockT, (*AssertionTesterInterface)(nil), nil) {
542 t.Error("Implements method should return false: nil does not implement AssertionTesterInterface")
543 }
544}
545
546func TestNotImplements(t *testing.T) {
547 t.Parallel()

Callers

nothing calls this directly

Calls 2

ImplementsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected