123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- package dao
- import (
- "go-common/app/admin/ep/melloi/model"
- "testing"
- "github.com/smartystreets/goconvey/convey"
- )
- func TestDaoTreesQuery(t *testing.T) {
- convey.Convey("TreesQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TreesQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoTreeNumQuery(t *testing.T) {
- convey.Convey("TreeNumQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TreeNumQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoTopHttpQuery(t *testing.T) {
- convey.Convey("TopHttpQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TopHttpQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoTopGrpcQuery(t *testing.T) {
- convey.Convey("TopGrpcQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TopGrpcQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoTopSceneQuery(t *testing.T) {
- convey.Convey("TopSceneQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TopSceneQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoTopDeptQuery(t *testing.T) {
- convey.Convey("TopDeptQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.TopDeptQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoBuildLineQuery(t *testing.T) {
- convey.Convey("BuildLineQuery", t, func(convCtx convey.C) {
- var (
- rank = &model.Rank{}
- summary = &model.ReportSummary{}
- )
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.BuildLineQuery(rank, summary)
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoStateLineQuery(t *testing.T) {
- convey.Convey("StateLineQuery", t, func(convCtx convey.C) {
- convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
- res, err := d.StateLineQuery()
- convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
- convCtx.So(err, convey.ShouldBeNil)
- convCtx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
|