chore: add more tests (#2409)

This commit is contained in:
Kevin Wan
2022-09-18 23:17:21 +08:00
committed by GitHub
parent 9138056c01
commit 5061158bd6
2 changed files with 29 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
package internal
import (
"io"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func TestEventHandler(t *testing.T) {
h := NewEventHandler(io.Discard, nil)
h.OnResolveMethod(nil)
h.OnSendHeaders(nil)
h.OnReceiveHeaders(nil)
h.OnReceiveTrailers(status.New(codes.OK, ""), nil)
assert.Equal(t, codes.OK, h.Status.Code())
h.OnReceiveResponse(nil)
}