2024-07-19 08:03:35 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestUser_TableName(t *testing.T) {
|
|
|
|
type fields struct {
|
2024-08-09 19:37:54 +00:00
|
|
|
BaseModel BaseModel[UserID]
|
2024-07-19 08:03:35 +00:00
|
|
|
Favorites []UserFavorites
|
|
|
|
Sources []UserSource
|
|
|
|
}
|
|
|
|
tests := []struct {
|
|
|
|
name string
|
|
|
|
fields fields
|
|
|
|
want string
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "Test 1: Is name User",
|
|
|
|
fields: fields{},
|
|
|
|
want: "User",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
us := User{
|
|
|
|
BaseModel: tt.fields.BaseModel,
|
|
|
|
Favorites: tt.fields.Favorites,
|
|
|
|
Sources: tt.fields.Sources,
|
|
|
|
}
|
|
|
|
if got := us.TableName(); got != tt.want {
|
|
|
|
t.Errorf("TableName() = %v, want %v", got, tt.want)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|