go-common/app/admin/main/workflow/dao/event_test.go
2019-04-22 18:49:16 +08:00

45 lines
1.1 KiB
Go

package dao
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDaoEventsByCid(t *testing.T) {
var c = context.TODO()
convey.Convey("events by cid", t, func() {
events, err := d.EventsByCid(c, 1)
convey.So(err, convey.ShouldBeNil)
convey.So(events, convey.ShouldNotBeNil)
})
}
func TestDaoEventsByIDs(t *testing.T) {
var c = context.TODO()
convey.Convey("events by multi event ids", t, func() {
events, err := d.EventsByIDs(c, []int64{1})
convey.So(err, convey.ShouldBeNil)
convey.So(events, convey.ShouldNotBeNil)
})
}
func TestDaoLastEventByCid(t *testing.T) {
var c = context.TODO()
convey.Convey("last event by eids", t, func() {
events, err := d.EventsByIDs(c, []int64{1})
convey.So(err, convey.ShouldBeNil)
convey.So(events, convey.ShouldNotBeNil)
})
}
func TestDaoBatchLastEventIDs(t *testing.T) {
var c = context.TODO()
convey.Convey("batch last event by multi cids", t, func() {
events, err := d.BatchLastEventIDs(c, []int64{1})
convey.So(err, convey.ShouldBeNil)
convey.So(events, convey.ShouldNotBeNil)
})
}