mc_test.go 917 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package report
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestReportSetReportCache(t *testing.T) {
  8. convey.Convey("SetReportCache", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. val = make(map[string]interface{})
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. err := d.SetReportCache(c, val)
  15. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestReportGetReportCache(t *testing.T) {
  22. convey.Convey("GetReportCache", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. res, err := d.GetReportCache(c)
  28. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. ctx.So(res, convey.ShouldNotBeNil)
  31. })
  32. })
  33. })
  34. }