MCPcopy
hub / github.com/runfinch/finch / Test_applyDefaults

Function Test_applyDefaults

pkg/config/defaults_linux_test.go:29–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func Test_applyDefaults(t *testing.T) {
30 t.Parallel()
31
32 testCases := []struct {
33 name string
34 cfg *Finch
35 mockSvc func(
36 deps *mocks.LoadSystemDeps,
37 mem *mocks.Memory,
38 ecc *mocks.CommandCreator,
39 ctrl *gomock.Controller,
40 )
41 want *Finch
42 }{
43 {
44 name: "happy path",
45 cfg: &Finch{},
46 mockSvc: func(
47 deps *mocks.LoadSystemDeps,
48 mem *mocks.Memory,
49 ecc *mocks.CommandCreator,
50 ctrl *gomock.Controller,
51 ) {
52 },
53 want: &Finch{},
54 },
55 }
56
57 for _, tc := range testCases {
58 t.Run(tc.name, func(t *testing.T) {
59 t.Parallel()
60
61 ctrl := gomock.NewController(t)
62 deps := mocks.NewLoadSystemDeps(ctrl)
63 mem := mocks.NewMemory(ctrl)
64 ecc := mocks.NewCommandCreator(ctrl)
65
66 tc.mockSvc(deps, mem, ecc, ctrl)
67
68 got := applyDefaults(tc.cfg, deps, mem, ecc)
69 require.Equal(t, tc.want, got)
70 })
71 }
72}

Callers

nothing calls this directly

Calls 5

NewLoadSystemDepsFunction · 0.92
NewMemoryFunction · 0.92
NewCommandCreatorFunction · 0.92
applyDefaultsFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected