package gamemanagement

import (
	"testing"

	gamev1 "hyapp.local/api/proto/game/v1"
)

func TestPlatformFromProtoReturnsCallbackSecret(t *testing.T) {
	const secret = "yomi-or-lingxian-secret"

	got := platformFromProto(&gamev1.GamePlatform{
		PlatformCode:      "yomi",
		CallbackSecret:    secret,
		CallbackSecretSet: true,
	})

	if got.CallbackSecret != secret {
		t.Fatalf("CallbackSecret = %q, want %q", got.CallbackSecret, secret)
	}
	if !got.CallbackSecretSet {
		t.Fatal("CallbackSecretSet = false, want true")
	}
}
