rpc_test.go 546 B

1234567891011121314151617181920212223242526
  1. package coin
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestCoinAddCoin(t *testing.T) {
  8. convey.Convey("AddCoin", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. mid = int64(27515256)
  12. aid = int64(10110817)
  13. coin = float64(-2.0)
  14. ip = "127.0.0.1"
  15. )
  16. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  17. err := d.AddCoin(c, mid, aid, coin, ip)
  18. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  19. ctx.So(err, convey.ShouldBeNil)
  20. })
  21. })
  22. })
  23. }