1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- package converge
- import (
- "context"
- "flag"
- "path/filepath"
- "reflect"
- "testing"
- "go-common/app/interface/main/app-card/model/card/operate"
- "go-common/app/interface/main/app-feed/conf"
- . "github.com/smartystreets/goconvey/convey"
- )
- var (
- d *Dao
- )
- func init() {
- dir, _ := filepath.Abs("../../cmd/app-feed-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_Cards(t *testing.T) {
- type args struct {
- c context.Context
- }
- tests := []struct {
- name string
- args args
- wantCm map[int64]*operate.Converge
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- Convey(tt.name, t, func() {
- gotCm, err := d.Cards(tt.args.c)
- So(gotCm, ShouldEqual, tt.wantCm)
- So(err, ShouldEqual, tt.wantErr)
- })
- }
- }
- func TestDao_Close(t *testing.T) {
- tests := []struct {
- name string
- dao *Dao
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- tt.dao.Close()
- })
- }
- }
|