Add test for entity/photo_keyword.go
This commit is contained in:
parent
cf08fd4256
commit
b5336eebb0
22
internal/entity/photo_keyword_test.go
Normal file
22
internal/entity/photo_keyword_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package entity
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewPhotoKeyword(t *testing.T) {
|
||||
t.Run("new keyword", func(t *testing.T) {
|
||||
m := NewPhotoKeyword(uint(3), uint(8))
|
||||
assert.Equal(t, uint(3), m.PhotoID)
|
||||
assert.Equal(t, uint(8), m.KeywordID)
|
||||
})
|
||||
}
|
||||
|
||||
func TestPhotoKeyword_TableName(t *testing.T) {
|
||||
photoKeyword := &PhotoKeyword{}
|
||||
tableName := photoKeyword.TableName()
|
||||
|
||||
assert.Equal(t, "photos_keywords", tableName)
|
||||
}
|
Loading…
Reference in a new issue