Files
gochat/backend/internal/handler/api/v1/platform_handler_test.go
T
2026-08-13 18:25:19 +08:00

22 lines
438 B
Go

package v1
import (
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/require"
)
func TestPlatformAppIDSupportsBothRoutes(t *testing.T) {
for _, params := range []gin.Param{
{Key: "id", Value: "7"},
{Key: "platform_app_id", Value: "7"},
} {
ctx, _ := gin.CreateTestContext(nil)
ctx.Params = []gin.Param{params}
id, err := platformAppID(ctx)
require.NoError(t, err)
require.Equal(t, uint(7), id)
}
}