audit_log_test.go 683 B

123456789101112131415161718192021222324252627282930
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestServiceAddAuditLog(t *testing.T) {
  8. convey.Convey("AddAuditLog", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. bizID = int(0)
  12. tp = int8(0)
  13. action = ""
  14. uid = int64(0)
  15. uname = ""
  16. oids = []int64{}
  17. index = []interface{}{}
  18. content map[string]interface{}
  19. )
  20. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  21. err := s.AddAuditLog(c, bizID, tp, action, uid, uname, oids, index, content)
  22. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  23. ctx.So(err, convey.ShouldBeNil)
  24. })
  25. })
  26. })
  27. }