aboutsummaryrefslogblamecommitdiffstats
path: root/entities/bug/op_add_comment_test.go
blob: fee9e785cb2796cacc6acd299ce8c74d52433a5f (plain) (tree)
1
2
3
4
5
6
7
8
9


           
                 
 
                                                          
                                               
                                                   
                                                   


                                            

                                                                                                                                                      
          

                                                                                                                                                      
          
 
package bug

import (
	"testing"

	"github.com/MichaelMure/git-bug/entities/identity"
	"github.com/MichaelMure/git-bug/entity"
	"github.com/MichaelMure/git-bug/entity/dag"
	"github.com/MichaelMure/git-bug/repository"
)

func TestAddCommentSerialize(t *testing.T) {
	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
		return NewAddCommentOp(author, unixTime, "message", nil), nil
	})
	dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
		return NewAddCommentOp(author, unixTime, "message", []repository.Hash{"hash1", "hash2"}), nil
	})
}