package book import "testing" func TestBookModelTableNames(t *testing.T) { tests := []struct { name string got string want string }{ {name: "book", got: Book{}.TableName(), want: "book"}, {name: "book_author", got: BookAuthor{}.TableName(), want: "book_author"}, {name: "book_author_relation", got: BookAuthorRelation{}.TableName(), want: "book_author_relation"}, {name: "book_chapter", got: BookChapter{}.TableName(), want: "book_chapter"}, {name: "book_comment", got: BookComment{}.TableName(), want: "book_comment"}, {name: "book_comment_like_record", got: BookCommentLikeRecord{}.TableName(), want: "book_comment_like_record"}, {name: "book_favorite_record", got: BookFavoriteRecord{}.TableName(), want: "book_favorite_record"}, {name: "book_read_record", got: BookReadRecord{}.TableName(), want: "book_read_record"}, {name: "book_series", got: BookSeries{}.TableName(), want: "book_series"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if tt.got != tt.want { t.Fatalf("TableName() = %q, want %q", tt.got, tt.want) } }) } }