uparchiveinfo_test.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package data
  2. import (
  3. "context"
  4. "go-common/app/admin/main/up/model/datamodel"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDataGetUpArchiveInfo(t *testing.T) {
  9. convey.Convey("GetUpArchiveInfo", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. arg = &datamodel.GetUpArchiveInfoArg{}
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. result, err := s.GetUpArchiveInfo(c, arg)
  16. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(result, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestDataGetUpArchiveTagInfo(t *testing.T) {
  24. convey.Convey("GetUpArchiveTagInfo", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. arg = &datamodel.GetUpArchiveTagInfoArg{}
  28. )
  29. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  30. result, err := s.GetUpArchiveTagInfo(c, arg)
  31. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldBeNil)
  33. ctx.So(result, convey.ShouldNotBeNil)
  34. })
  35. })
  36. })
  37. }
  38. func TestDataGetUpArchiveTypeInfo(t *testing.T) {
  39. convey.Convey("GetUpArchiveTypeInfo", t, func(ctx convey.C) {
  40. var (
  41. c = context.Background()
  42. arg = &datamodel.GetUpArchiveTypeInfoArg{}
  43. )
  44. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  45. result, err := s.GetUpArchiveTypeInfo(c, arg)
  46. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  47. ctx.So(err, convey.ShouldBeNil)
  48. ctx.So(result, convey.ShouldNotBeNil)
  49. })
  50. })
  51. })
  52. }