advance_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestBuyAdvance(t *testing.T) {
  8. Convey("test adv State", t, func() {
  9. err := svr.BuyAdvance(c, 27515330, 10107292, "sp")
  10. So(err, ShouldBeNil)
  11. })
  12. }
  13. func TestAdvanceState(t *testing.T) {
  14. Convey("test adv State", t, func() {
  15. _, err := svr.AdvanceState(c, 27515330, 10107292, "sp")
  16. So(err, ShouldBeNil)
  17. })
  18. }
  19. func TestAdvances(t *testing.T) {
  20. Convey("test adv", t, func() {
  21. res, err := svr.Advances(context.TODO(), 27515260)
  22. So(err, ShouldBeNil)
  23. So(res, ShouldNotBeEmpty)
  24. })
  25. }
  26. func TestPassAdvance(t *testing.T) {
  27. Convey("test pass adv", t, func() {
  28. err := svr.PassAdvance(context.TODO(), 7158471, 2)
  29. So(err, ShouldBeNil)
  30. })
  31. }
  32. func TestDenyAdvance(t *testing.T) {
  33. Convey("test deny adv", t, func() {
  34. err := svr.DenyAdvance(context.TODO(), 27515615, 107)
  35. So(err, ShouldBeNil)
  36. })
  37. }
  38. func TestCancelAdvance(t *testing.T) {
  39. Convey("test cancel adv", t, func() {
  40. err := svr.CancelAdvance(context.TODO(), 27515615, 122)
  41. So(err, ShouldBeNil)
  42. })
  43. }