MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / TestDescUser

Function TestDescUser

cmd/desc_user_test.go:30–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestDescUser(t *testing.T) {
31 tt := []struct {
32 name string
33 args []string
34 expect testResult
35 }{
36 {
37 name: "describe existing username successfully",
38 args: []string{"matt.hunter"},
39 expect: pass,
40 },
41 {
42 name: "describe existing user id successfully",
43 args: []string{"3"},
44 expect: pass,
45 },
46 {
47 name: "describe non existent user id should fail",
48 args: []string{"999"},
49 expect: fail,
50 },
51 }
52
53 for _, tc := range tt {
54 t.Run(tc.name, func(t *testing.T) {
55 execT := execTestCmdFlags{
56 t: t,
57 cmd: descUserCmd,
58 args: tc.args,
59 }
60 stdout, execResult := execT.executeCommand()
61 fmt.Println(stdout)
62 require.Equal(t, tc.expect, execResult, tc.args[0], stdout)
63 })
64 }
65}

Callers

nothing calls this directly

Calls 1

executeCommandMethod · 0.95

Tested by

no test coverage detected