go-common/app/service/live/wallet/dao/coinexchange_test.go

28 lines
600 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
. "github.com/smartystreets/goconvey/convey"
"go-common/app/service/live/wallet/model"
"testing"
"time"
)
func TestDao_NewCoinExchangeRecord(t *testing.T) {
Convey("New CoinExchange", t, func() {
once.Do(startService)
record := new(model.CoinExchangeRecord)
record.ExchangeTime = time.Now().Unix()
record.Status = 1
record.DestNum = 1
record.DestType = 1
record.SrcType = 2
record.SrcNum = 1
record.TransactionId = "abcdef"
record.Uid = 1
affect, err := d.NewCoinExchangeRecord(ctx, record)
So(affect, ShouldEqual, 1)
So(err, ShouldBeNil)
})
}