archive_oper_test.go 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package archive
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. "go-common/app/job/main/videoup-report/model/archive"
  7. )
  8. func TestDao_AddArchiveOper(t *testing.T) {
  9. Convey("AddArchiveOper", t, func() {
  10. c := context.TODO()
  11. a, _ := d.ArchiveByAid(c, 1)
  12. id, err := d.AddArchiveOper(context.TODO(), a.ID, a.Attribute, a.TypeID, a.State, a.Round, 0, "随意一个变更", "测试啦")
  13. So(err, ShouldBeNil)
  14. Println(id)
  15. })
  16. }
  17. func Test_LastVideoOperUID(t *testing.T) {
  18. var (
  19. c = context.TODO()
  20. err error
  21. sub int64
  22. )
  23. Convey("LastVideoOperUID", t, func() {
  24. sub, err = d.LastVideoOperUID(c, 2333)
  25. So(err, ShouldNotBeNil)
  26. So(sub, ShouldBeZeroValue)
  27. })
  28. }
  29. func Test_LastVideoOper(t *testing.T) {
  30. var (
  31. c = context.TODO()
  32. err error
  33. sub *archive.VideoOper
  34. )
  35. Convey("LastVideoOper", t, func() {
  36. sub, err = d.LastVideoOper(c, 2333)
  37. So(err, ShouldNotBeNil)
  38. So(sub, ShouldNotBeNil)
  39. })
  40. }