coinexchange_test.go 600 B

123456789101112131415161718192021222324252627
  1. package dao
  2. import (
  3. . "github.com/smartystreets/goconvey/convey"
  4. "go-common/app/service/live/wallet/model"
  5. "testing"
  6. "time"
  7. )
  8. func TestDao_NewCoinExchangeRecord(t *testing.T) {
  9. Convey("New CoinExchange", t, func() {
  10. once.Do(startService)
  11. record := new(model.CoinExchangeRecord)
  12. record.ExchangeTime = time.Now().Unix()
  13. record.Status = 1
  14. record.DestNum = 1
  15. record.DestType = 1
  16. record.SrcType = 2
  17. record.SrcNum = 1
  18. record.TransactionId = "abcdef"
  19. record.Uid = 1
  20. affect, err := d.NewCoinExchangeRecord(ctx, record)
  21. So(affect, ShouldEqual, 1)
  22. So(err, ShouldBeNil)
  23. })
  24. }