aboutsummaryrefslogblamecommitdiffstats
path: root/entity/dag/op_noop_test.go
blob: 61497b5b19b85e1effd791e7e8dc8a3b2951f191 (plain) (tree)
1
2
3
4
5
6
7
8


           
                       

                 
                                                          
                                               


                                      





                                                                                                              

          
package dag

import (
	"encoding/json"
	"testing"

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

func TestNoopSerialize(t *testing.T) {
	SerializeRoundTripTest(t, func(raw json.RawMessage, resolver entity.Resolvers) (Operation, error) {
		var op NoOpOperation[*snapshotMock]
		err := json.Unmarshal(raw, &op)
		return &op, err
	}, func(author identity.Interface, unixTime int64) (*NoOpOperation[*snapshotMock], entity.Resolvers) {
		return NewNoOpOp[*snapshotMock](1, author, unixTime), nil
	})
}