app_test.go 865 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/open/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoAddApp(t *testing.T) {
  9. convey.Convey("AddApp", t, func() {
  10. p1 := d.AddApp(context.TODO(), nil)
  11. convey.So(p1, convey.ShouldBeNil)
  12. })
  13. }
  14. func TestDaoDelApp(t *testing.T) {
  15. convey.Convey("DelApp", t, func() {
  16. p1 := d.DelApp(context.TODO(), 0)
  17. convey.So(p1, convey.ShouldBeNil)
  18. })
  19. }
  20. func TestDaoUpdateApp(t *testing.T) {
  21. bean := &model.AppParams{
  22. AppID: 123,
  23. AppName: "xxx",
  24. }
  25. convey.Convey("UpdateApp", t, func() {
  26. p1 := d.UpdateApp(context.TODO(), bean)
  27. convey.So(p1, convey.ShouldBeNil)
  28. })
  29. }
  30. func TestDaoListApp(t *testing.T) {
  31. convey.Convey("ListApp", t, func() {
  32. res, err := d.ListApp(context.TODO(), nil)
  33. convey.So(err, convey.ShouldBeNil)
  34. convey.So(res, convey.ShouldNotBeNil)
  35. })
  36. }