op_add_comment_test.go

 1package bug
 2
 3import (
 4	"testing"
 5
 6	"github.com/MichaelMure/git-bug/entity"
 7	"github.com/MichaelMure/git-bug/entity/dag"
 8	"github.com/MichaelMure/git-bug/repository"
 9)
10
11func TestAddCommentSerialize(t *testing.T) {
12	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
13		return NewAddCommentOp(author, unixTime, "message", nil), nil
14	})
15	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
16		return NewAddCommentOp(author, unixTime, "message", []repository.Hash{"hash1", "hash2"}), nil
17	})
18}