Files
gotsrpc/example/context/service/handler_test.go
Kevin Franklin Kim 3c7c56b2f0 fix: checks
2025-11-07 07:22:40 +01:00

22 lines
521 B
Go

package service_test
import (
"testing"
"github.com/foomo/gotsrpc/v2/example/context/service"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestHandler(t *testing.T) {
h := &service.Handler{}
msg := "foomo"
assert.Equal(t, "Hello foomo", h.Hello(t.Context(), msg))
require.Error(t, h.TypedError(t.Context(), msg))
require.Error(t, h.CustomError(t.Context(), msg))
require.Error(t, h.WrappedError(t.Context(), msg))
require.Error(t, h.StandardError(t.Context(), msg))
}