mysql_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package dao
  2. import (
  3. "testing"
  4. "time"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestSettlePeriod(t *testing.T) {
  8. Convey("SettlePeriod", t, func() {
  9. _, err := d.SettlePeriod(ctx, 2)
  10. So(err, ShouldBeNil)
  11. })
  12. }
  13. func TestHitSettlePeriod(t *testing.T) {
  14. Convey("HitSettlePeriod", t, func() {
  15. _, err := d.HitSettlePeriod(ctx, time.Now())
  16. So(err, ShouldBeNil)
  17. })
  18. }
  19. func TestUpdateSettle(t *testing.T) {
  20. Convey("UpdateSettle", t, func() {
  21. err := d.UpdateSettle(ctx, 1, 1, 10, time.Now())
  22. So(err, ShouldBeNil)
  23. })
  24. }
  25. func TestUpdateCoinCount(t *testing.T) {
  26. Convey("UpdateCoinCount", t, func() {
  27. err := d.UpdateCoinCount(ctx, 1, 1, 10, 1, time.Now())
  28. So(err, ShouldBeNil)
  29. })
  30. }
  31. func TestEvery10000(t *testing.T) {
  32. Convey("Every10000", t, func() {
  33. _, _, err := d.Every10000(ctx, 1, 1)
  34. So(err, ShouldBeNil)
  35. })
  36. }
  37. func TestUpsertSettle(t *testing.T) {
  38. Convey("UpsertSettle", t, func() {
  39. err := d.UpsertSettle(ctx, 1, 1, 1, 1, 1, time.Now())
  40. So(err, ShouldBeNil)
  41. })
  42. }
  43. func TestTotalCoins(t *testing.T) {
  44. Convey("TotalCoins", t, func() {
  45. _, err := d.TotalCoins(ctx, 1, time.Now(), time.Now())
  46. So(err, ShouldBeNil)
  47. })
  48. }