refactor platform account and access models
This commit is contained in:
23
backend/api/internal/models/platform_models_test.go
Normal file
23
backend/api/internal/models/platform_models_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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: "menu", table: &PlatformMenu{}, want: "platform_menu"},
|
||||
{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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user