123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package service
- import (
- "context"
- "testing"
- "go-common/app/job/main/figure/model"
- repmol "go-common/app/job/main/reply/model/reply"
- . "github.com/smartystreets/goconvey/convey"
- )
- var (
- testReplyMid int64 = 120
- testRefReplyMid int64 = 121
- )
- // go test -test.v -test.run TestPutReplyInfo
- func TestPutReplyInfo(t *testing.T) {
- Convey("TestPutReplyInfo put add reply", t, WithService(func(s *Service) {
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventAdd,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- }))
- Convey("TestPutReplyInfo put add reply", t, WithService(func(s *Service) {
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventLike,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventLike,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- }))
- Convey("TestPutReplyInfo put add reply", t, WithService(func(s *Service) {
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventLikeCancel,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- }))
- Convey("TestPutReplyInfo put hate", t, WithService(func(s *Service) {
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventHate,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- }))
- Convey("TestPutReplyInfo put hate cancel", t, WithService(func(s *Service) {
- So(s.PutReplyInfo(context.TODO(), &model.ReplyEvent{
- Mid: testReplyMid,
- Action: model.EventHateCancel,
- Reply: &repmol.Reply{
- Mid: testRefReplyMid,
- },
- }), ShouldBeNil)
- }))
- }
|