api_test.go 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package favorite
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestIsFavDefault(t *testing.T) {
  8. convey.Convey("IsFavDefault", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. _, err := d.IsFavDefault(c, 1, 1)
  14. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestIsFav(t *testing.T) {
  21. convey.Convey("IsFav", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. )
  25. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  26. _, err := d.IsFav(c, 1, 1)
  27. ctx.Convey("Then err should be nil", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. })
  30. })
  31. })
  32. }
  33. func TestAddFav(t *testing.T) {
  34. convey.Convey("AddFav", t, func(ctx convey.C) {
  35. var (
  36. c = context.Background()
  37. )
  38. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  39. d.AddFav(c, 1, 1)
  40. })
  41. })
  42. }