Files
platforms/backend/api/internal/models/platform_models_test.go
2026-07-29 13:18:52 +08:00

23 lines
598 B
Go

package models
import "testing"
func TestPlatformModelTableNames(t *testing.T) {
tests := []struct {
name string
table interface{ TableName() string }
want string
}{
{name: "account", table: &PlatformAccount{}, want: "platform_account"},
{name: "role", table: &PlatformRole{}, want: "platform_role"},
{name: "role menu", table: &PlatformRoleMenu{}, want: "platform_role_menu"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if got := test.table.TableName(); got != test.want {
t.Fatalf("TableName() = %q, want %q", got, test.want)
}
})
}
}