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"}, {name: "producer account", table: &ProducerAccount{}, want: "producer_account"}, } 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) } }) } }