panel_test.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package dao
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoVipPayOrderSuccs(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. mid = int64(0)
  12. )
  13. convey.Convey("VipPayOrderSuccs", t, func(ctx convey.C) {
  14. mpo, err := d.VipPayOrderSuccs(c, mid)
  15. ctx.Convey("Error should be nil", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. ctx.Convey("mpo should not be nil", func(ctx convey.C) {
  19. ctx.So(mpo, convey.ShouldNotBeNil)
  20. })
  21. })
  22. }
  23. func TestDaoVipPriceConfigs(t *testing.T) {
  24. var (
  25. c = context.TODO()
  26. )
  27. convey.Convey("VipPriceConfigs", t, func(ctx convey.C) {
  28. vpcs, err := d.VipPriceConfigs(c)
  29. ctx.Convey("Error should be nil", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. })
  32. ctx.Convey("vpcs should not be nil", func(ctx convey.C) {
  33. ctx.So(vpcs, convey.ShouldNotBeNil)
  34. })
  35. })
  36. }
  37. func TestDaoVipPriceDiscountConfigs(t *testing.T) {
  38. var (
  39. c = context.TODO()
  40. )
  41. convey.Convey("VipPriceDiscountConfigs", t, func(ctx convey.C) {
  42. mvp, err := d.VipPriceDiscountConfigs(c)
  43. ctx.Convey("Error should be nil", func(ctx convey.C) {
  44. ctx.So(err, convey.ShouldBeNil)
  45. })
  46. ctx.Convey("mvp should not be nil", func(ctx convey.C) {
  47. ctx.So(mvp, convey.ShouldNotBeNil)
  48. })
  49. })
  50. }
  51. func TestDaoVipPriceDiscountByProductID(t *testing.T) {
  52. var c = context.Background()
  53. convey.Convey("TestDaoVipPriceDiscountByProductID", t, func(ctx convey.C) {
  54. mvp, err := d.VipPriceDiscountByProductID(c, "tv.danmaku.bilibilihd.big12month")
  55. fmt.Println("mvp:", mvp)
  56. ctx.Convey("Error should be nil", func(ctx convey.C) {
  57. ctx.So(err, convey.ShouldBeNil)
  58. })
  59. ctx.Convey("mvp should not be nil", func(ctx convey.C) {
  60. ctx.So(mvp, convey.ShouldNotBeNil)
  61. })
  62. })
  63. }
  64. func TestDaoVipPriceByProductID(t *testing.T) {
  65. var c = context.Background()
  66. convey.Convey("TestDaoVipPriceByProductID", t, func(ctx convey.C) {
  67. mvp, err := d.VipPriceByProductID(c, "tv.danmaku.bilibilihd.big12month")
  68. fmt.Println("mvp:", mvp)
  69. ctx.Convey("Error should be nil", func(ctx convey.C) {
  70. ctx.So(err, convey.ShouldBeNil)
  71. })
  72. ctx.Convey("mvp should not be nil", func(ctx convey.C) {
  73. ctx.So(mvp, convey.ShouldNotBeNil)
  74. })
  75. })
  76. }