-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerdeterCommand_test.go
41 lines (36 loc) · 1.08 KB
/
VerdeterCommand_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package verdeter_test
import (
"fmt"
"testing"
"github.com/ditrit/verdeter"
"github.com/stretchr/testify/assert"
)
// testing contructor of VerdeterCommand
func TestNewVerdeterCommand(t *testing.T) {
verdeterCmd := verdeter.NewVerdeterCommand(
"test",
"test short description",
"test long description",
func(verdeterCmd *verdeter.VerdeterCommand, args []string) error {
fmt.Println("hello mom")
return nil
},
)
assert.NotNil(t, verdeterCmd, "func NewVerdeterCommand should not return something nil")
}
func TestNewVerdeterCommandLookup(t *testing.T) {
verdeterCmd := verdeter.NewVerdeterCommand(
"test",
"test short description",
"test long description",
func(verdeterCmd *verdeter.VerdeterCommand, args []string) error {
fmt.Println("hello mom")
return nil
},
)
assert.Nil(t, verdeterCmd.Lookup("some.config"))
verdeterCmd.GKey("some.config", verdeter.IsInt, "", "some.config is an simple config key for a unit test")
if assert.NotNil(t, verdeterCmd.Lookup("some.config")) {
assert.Equal(t, "some.config", verdeterCmd.Lookup("some.config").Name)
}
}