MCPcopy Create free account
hub / github.com/auth0/auth0-cli / TestFlagGetters

Function TestFlagGetters

internal/cli/flags_test.go:9–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestFlagGetters(t *testing.T) {
10 t.Run("returns the name", func(t *testing.T) {
11 flag := Flag{Name: "Foo"}
12 want := "Foo"
13 got := flag.GetName()
14
15 assert.Equal(t, want, got)
16 })
17
18 t.Run("returns the label", func(t *testing.T) {
19 flag := Flag{Name: "Foo"}
20 want := "Foo:"
21 got := flag.GetLabel()
22
23 assert.Equal(t, want, got)
24 })
25
26 t.Run("returns the help", func(t *testing.T) {
27 flag := Flag{Help: "Foo"}
28 want := "Foo"
29 got := flag.GetHelp()
30
31 assert.Equal(t, want, got)
32 })
33
34 t.Run("returns that the flag is required", func(t *testing.T) {
35 flag := Flag{IsRequired: true}
36 want := true
37 got := flag.GetIsRequired()
38
39 assert.Equal(t, want, got)
40 })
41
42 t.Run("returns that the flag is not required", func(t *testing.T) {
43 flag := Flag{IsRequired: false}
44 want := false
45 got := flag.GetIsRequired()
46
47 assert.Equal(t, want, got)
48 })
49}

Callers

nothing calls this directly

Calls 4

GetNameMethod · 0.95
GetLabelMethod · 0.95
GetHelpMethod · 0.95
GetIsRequiredMethod · 0.95

Tested by

no test coverage detected