MCPcopy Create free account
hub / github.com/DoNewsCode/core / TestPreferDriverInDI

Function TestPreferDriverInDI

leader/dependency_test.go:123–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestPreferDriverInDI(t *testing.T) {
124 g := dig.New()
125 g.Provide(func() Driver {
126 return mockDriver{}
127 })
128 driver, err := newDefaultDriver(DriverArgs{
129 Populator: di.IntoPopulator(g),
130 })
131 assert.NoError(t, err)
132 assert.IsType(t, mockDriver{}, driver)
133}
134
135func TestPreferDriverInDI_error(t *testing.T) {
136 g := dig.New()

Callers

nothing calls this directly

Calls 3

IntoPopulatorFunction · 0.92
newDefaultDriverFunction · 0.85
ProvideMethod · 0.80

Tested by

no test coverage detected