Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
package dao
import (
"context"
"gopkg.in/h2non/gock.v1"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDaoMessage(t *testing.T) {
convey.Convey("Message", t, func(ctx convey.C) {
var (
c = context.Background()
title = "abc test"
msg = "abc"
mids = []int64{112}
mc = "2_2_2"
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
defer gock.OffAll()
httpMock("POST", d.msgURL).Reply(200).JSON(`{"code":0}`)
err := d.RawMessage(c, mc, title, msg, mids)
ctx.So(err, convey.ShouldBeNil)
})
})
}
func TestDaoRawMessage(t *testing.T) {
convey.Convey("RawMessage", t, func(ctx convey.C) {
var (
c = context.Background()
mc = "2_2_2"
title = "abc test"
msg = "abc test"
mids = []int64{112}
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
defer gock.OffAll()
httpMock("POST", d.msgURL).Reply(200).JSON(`{"code":0}`)
err := d.RawMessage(c, mc, title, msg, mids)
ctx.So(err, convey.ShouldBeNil)
})
})
}