mysql_upper_test.go 839 B

12345678910111213141516171819202122232425262728293031323334
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_UpperPassed(t *testing.T) {
  8. Convey("get data", t, WithMysql(func(d *Dao) {
  9. aids, err := d.UpperPassed(context.TODO(), dataMID)
  10. So(err, ShouldBeNil)
  11. So(aids, ShouldNotBeEmpty)
  12. }))
  13. Convey("no data", t, WithMysql(func(d *Dao) {
  14. aids, err := d.UpperPassed(context.TODO(), noDataMID)
  15. So(err, ShouldBeNil)
  16. So(aids, ShouldBeEmpty)
  17. }))
  18. }
  19. func Test_UppersPassed(t *testing.T) {
  20. Convey("get data", t, WithMysql(func(d *Dao) {
  21. arts, err := d.UppersPassed(context.TODO(), []int64{dataMID})
  22. So(err, ShouldBeNil)
  23. So(arts, ShouldNotBeEmpty)
  24. }))
  25. Convey("no data", t, WithMysql(func(d *Dao) {
  26. arts, err := d.UppersPassed(context.TODO(), []int64{noDataMID})
  27. So(err, ShouldBeNil)
  28. So(arts[noDataMID], ShouldBeEmpty)
  29. }))
  30. }