db_test.go 912 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package monitor
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestMonitorRulesByBid(t *testing.T) {
  8. convey.Convey("RulesByBid", t, func(convCtx convey.C) {
  9. var (
  10. c = context.Background()
  11. bid = int64(2)
  12. )
  13. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  14. _, err := d.RulesByBid(c, bid)
  15. convCtx.Convey("Then err should be nil.rules should not be nil.", func(convCtx convey.C) {
  16. convCtx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestMonitorValidRules(t *testing.T) {
  22. convey.Convey("ValidRules", t, func(convCtx convey.C) {
  23. var (
  24. c = context.Background()
  25. )
  26. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  27. _, err := d.ValidRules(c)
  28. convCtx.Convey("Then err should be nil.rules should not be nil.", func(convCtx convey.C) {
  29. convCtx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. })
  33. }