1package dag
2
3import (
4 "encoding/json"
5 "testing"
6
7 "github.com/MichaelMure/git-bug/entities/identity"
8 "github.com/MichaelMure/git-bug/entity"
9)
10
11func TestNoopSerialize(t *testing.T) {
12 SerializeRoundTripTest(t, func(raw json.RawMessage, resolver entity.Resolvers) (Operation, error) {
13 var op NoOpOperation[*snapshotMock]
14 err := json.Unmarshal(raw, &op)
15 return &op, err
16 }, func(author identity.Interface, unixTime int64) (*NoOpOperation[*snapshotMock], entity.Resolvers) {
17 return NewNoOpOp[*snapshotMock](1, author, unixTime), nil
18 })
19}