event_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoEventsByCid(t *testing.T) {
  8. var c = context.TODO()
  9. convey.Convey("events by cid", t, func() {
  10. events, err := d.EventsByCid(c, 1)
  11. convey.So(err, convey.ShouldBeNil)
  12. convey.So(events, convey.ShouldNotBeNil)
  13. })
  14. }
  15. func TestDaoEventsByIDs(t *testing.T) {
  16. var c = context.TODO()
  17. convey.Convey("events by multi event ids", t, func() {
  18. events, err := d.EventsByIDs(c, []int64{1})
  19. convey.So(err, convey.ShouldBeNil)
  20. convey.So(events, convey.ShouldNotBeNil)
  21. })
  22. }
  23. func TestDaoLastEventByCid(t *testing.T) {
  24. var c = context.TODO()
  25. convey.Convey("last event by eids", t, func() {
  26. events, err := d.EventsByIDs(c, []int64{1})
  27. convey.So(err, convey.ShouldBeNil)
  28. convey.So(events, convey.ShouldNotBeNil)
  29. })
  30. }
  31. func TestDaoBatchLastEventIDs(t *testing.T) {
  32. var c = context.TODO()
  33. convey.Convey("batch last event by multi cids", t, func() {
  34. events, err := d.BatchLastEventIDs(c, []int64{1})
  35. convey.So(err, convey.ShouldBeNil)
  36. convey.So(events, convey.ShouldNotBeNil)
  37. })
  38. }