flow_resource_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package gorm
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestDaoFRByFlow(t *testing.T) {
  7. convey.Convey("FRByFlow", t, func(ctx convey.C) {
  8. _, err := d.FRByFlow(cntx, []int64{})
  9. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  10. ctx.So(err, convey.ShouldBeNil)
  11. })
  12. })
  13. }
  14. func TestDaoFRByNetRID(t *testing.T) {
  15. convey.Convey("FRByNetRID", t, func(ctx convey.C) {
  16. _, err := d.FRByNetRID(cntx, []int64{}, []int64{}, false)
  17. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. })
  20. })
  21. }
  22. func TestDaoFRByUniques(t *testing.T) {
  23. convey.Convey("FRByUniques", t, func(ctx convey.C) {
  24. _, err := d.FRByUniques(cntx, []int64{1}, []int64{1}, true)
  25. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  26. ctx.So(err, convey.ShouldBeNil)
  27. })
  28. })
  29. }
  30. func TestDaoCancelFlowResource(t *testing.T) {
  31. tx, _ := d.BeginTx(cntx)
  32. defer tx.Commit()
  33. convey.Convey("CancelFlowResource", t, func(ctx convey.C) {
  34. err := d.CancelFlowResource(cntx, tx, []int64{})
  35. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  36. ctx.So(err, convey.ShouldBeNil)
  37. })
  38. })
  39. }