op_add_item_draft_test.go

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