66 lines
1.1 KiB
Go
66 lines
1.1 KiB
Go
package ai
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"path/filepath"
|
|
"reflect"
|
|
"testing"
|
|
|
|
"go-common/app/interface/main/app-view/conf"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
)
|
|
|
|
var (
|
|
d *Dao
|
|
)
|
|
|
|
func init() {
|
|
dir, _ := filepath.Abs("../../cmd/app-view-test.toml")
|
|
flag.Set("conf", dir)
|
|
conf.Init()
|
|
d = New(conf.Conf)
|
|
}
|
|
|
|
func TestNew(t *testing.T) {
|
|
type args struct {
|
|
c *conf.Config
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
wantD *Dao
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if gotD := New(tt.args.c); !reflect.DeepEqual(gotD, tt.wantD) {
|
|
t.Errorf("New() = %v, want %v", gotD, tt.wantD)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestDao_Av2Game(t *testing.T) {
|
|
type args struct {
|
|
c context.Context
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
wantRes map[int64]int64
|
|
wantErr bool
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
Convey(tt.name, t, func() {
|
|
gotRes, err := d.Av2Game(tt.args.c)
|
|
So(err, ShouldEqual, tt.wantErr)
|
|
So(gotRes, ShouldResemble, tt.wantRes)
|
|
})
|
|
}
|
|
}
|