op_label_change_test.go

 1package bug
 2
 3import (
 4	"testing"
 5
 6	"github.com/git-bug/git-bug/entities/common"
 7	"github.com/git-bug/git-bug/entities/identity"
 8	"github.com/git-bug/git-bug/entity"
 9	"github.com/git-bug/git-bug/entity/dag"
10)
11
12func TestLabelChangeSerialize(t *testing.T) {
13	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
14		return NewLabelChangeOperation(author, unixTime, []common.Label{"added"}, []common.Label{"removed"}), nil
15	})
16	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
17		return NewLabelChangeOperation(author, unixTime, []common.Label{"added"}, nil), nil
18	})
19	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
20		return NewLabelChangeOperation(author, unixTime, nil, []common.Label{"removed"}), nil
21	})
22}