MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestBind

Function TestBind

di/optional_provider_test.go:29–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestBind(t *testing.T) {
30 ctor := func() Stub {
31 return Stub{}
32 }
33 g := core.New()
34 g.Provide(di.Deps{ctor, di.Bind(new(Stub), new(Fooer))})
35 g.Invoke(func(f Fooer) {
36 assert.NotNil(t, f)
37 })
38}
39
40func TestName(t *testing.T) {
41 g := core.New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
BindFunction · 0.92
ProvideMethod · 0.80
InvokeMethod · 0.80

Tested by

no test coverage detected