index_test.go 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package dao
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "go-common/app/job/main/dm/model"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestDMInfos(t *testing.T) {
  10. Convey("", t, func() {
  11. dms, err := testDao.DMInfos(context.TODO(), 1, 1221)
  12. if err != nil {
  13. fmt.Println(err)
  14. }
  15. So(err, ShouldBeNil)
  16. So(dms, ShouldNotBeEmpty)
  17. })
  18. }
  19. func TestDMHides(t *testing.T) {
  20. Convey("", t, func() {
  21. dms, err := testDao.DMHides(context.TODO(), 1, 1221, 1)
  22. if err != nil {
  23. fmt.Println(err)
  24. }
  25. So(err, ShouldBeNil)
  26. So(dms, ShouldNotBeEmpty)
  27. })
  28. }
  29. func TestUpdateDM(t *testing.T) {
  30. Convey("", t, func() {
  31. dm := &model.DM{
  32. ID: 1234555,
  33. Oid: 1221,
  34. State: 3,
  35. }
  36. _, err := testDao.UpdateDM(context.TODO(), dm)
  37. So(err, ShouldBeNil)
  38. })
  39. }
  40. func TestUpdateDMStates(t *testing.T) {
  41. Convey("", t, func() {
  42. dmids := []int64{709150141, 709150142}
  43. _, err := testDao.UpdateDMStates(context.TODO(), 1221, dmids, 1)
  44. So(err, ShouldBeNil)
  45. })
  46. }