weight_log_test.go 861 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaohashRowKey(t *testing.T) {
  8. convey.Convey("hashRowKey", t, func(ctx convey.C) {
  9. var (
  10. tid = int64(0)
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. p1 := hashRowKey(tid)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDaoWeightLog(t *testing.T) {
  21. convey.Convey("WeightLog", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. taskid = int64(0)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. ls, err := d.WeightLog(c, taskid)
  28. ctx.Convey("Then err should be nil.ls should not be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. ctx.So(ls, convey.ShouldNotBeNil)
  31. })
  32. })
  33. })
  34. }