SoXX
85d7905e8a
- Update model references from `UserFavorites` to `UserFavorite` in multiple files. - Adjust database queries and struct definitions accordingly to maintain consistency.
38 lines
669 B
Go
38 lines
669 B
Go
package models
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestUserFavorite_TableName(t *testing.T) {
|
|
type fields struct {
|
|
UserID string
|
|
PostID string
|
|
CreatedAt time.Time
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want string
|
|
}{
|
|
{
|
|
name: "Test 1: Is name UserFavorite",
|
|
fields: fields{},
|
|
want: "UserFavorite",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
us := UserFavorite{
|
|
UserID: tt.fields.UserID,
|
|
PostID: tt.fields.PostID,
|
|
CreatedAt: tt.fields.CreatedAt,
|
|
}
|
|
if got := us.TableName(); got != tt.want {
|
|
t.Errorf("TableName() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|