monitor_test.go 928 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package mysql
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestMysqlMoniBizRules(t *testing.T) {
  8. convey.Convey("MoniBizRules", 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.MoniBizRules(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 TestMysqlMoniRule(t *testing.T) {
  22. convey.Convey("MoniRule", t, func(convCtx convey.C) {
  23. var (
  24. c = context.Background()
  25. id = int64(1)
  26. )
  27. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  28. _, err := d.MoniRule(c, id)
  29. convCtx.Convey("Then err should be nil.rules should not be nil.", func(convCtx convey.C) {
  30. convCtx.So(err, convey.ShouldBeNil)
  31. })
  32. })
  33. })
  34. }