1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package dao
- import (
- "context"
- "testing"
- "github.com/smartystreets/goconvey/convey"
- )
- func TestDaonoticeHit(t *testing.T) {
- convey.Convey("noticeHit", t, func(ctx convey.C) {
- var (
- mid = int64(0)
- )
- ctx.Convey("When everything goes positive", func(ctx convey.C) {
- p1 := noticeHit(mid)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaonoticeKey(t *testing.T) {
- convey.Convey("noticeKey", t, func(ctx convey.C) {
- var (
- mid = int64(0)
- )
- ctx.Convey("When everything goes positive", func(ctx convey.C) {
- p1 := noticeKey(mid)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoRawNotice(t *testing.T) {
- convey.Convey("RawNotice", t, func(ctx convey.C) {
- var (
- c = context.Background()
- mid = int64(0)
- )
- ctx.Convey("When everything goes positive", func(ctx convey.C) {
- res, err := d.RawNotice(c, mid)
- ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- ctx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoSetNotice(t *testing.T) {
- convey.Convey("SetNotice", t, func(ctx convey.C) {
- var (
- c = context.Background()
- mid = int64(0)
- notice = ""
- )
- ctx.Convey("When everything goes positive", func(ctx convey.C) {
- err := d.SetNotice(c, mid, notice)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
|