-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore_install_test.go
58 lines (56 loc) · 1.25 KB
/
core_install_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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package gowpcli_test
import (
"reflect"
"testing"
"github.com/bukowa/gowpcli/generated/core/install"
)
func TestInstall_Args(t *testing.T) {
type fields struct {
Url string
Title string
AdminUser string
AdminPassword string
AdminEmail string
SkipEmail bool
}
tests := []struct {
name string
fields fields
want []string
}{
{name: "1", fields: fields{
Url: "http://asd.com",
Title: "test title",
AdminUser: "usr",
AdminPassword: "passwd",
AdminEmail: "",
SkipEmail: true,
}, want: []string{
"core",
"install",
"--url=http://asd.com",
"--title=test title",
"--admin_user=usr",
"--admin_password=passwd",
"--skip-email",
}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
i := install.Install{
Url: tt.fields.Url,
Title: tt.fields.Title,
AdminUser: tt.fields.AdminUser,
AdminPassword: tt.fields.AdminPassword,
AdminEmail: tt.fields.AdminEmail,
SkipEmail: tt.fields.SkipEmail,
}
args := i.Args()
//sort.Strings(args)
//sort.Strings(tt.want)
if got := args; !reflect.DeepEqual(got, tt.want) {
t.Errorf("Args() = %v, want %v", got, tt.want)
}
})
}
}