Add tests for label model
This commit is contained in:
parent
2eb0011377
commit
adead738cd
1 changed files with 21 additions and 0 deletions
21
internal/models/label_test.go
Normal file
21
internal/models/label_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewLabel(t *testing.T) {
|
||||
t.Run("name Unicorn2000 priority 5", func(t *testing.T) {
|
||||
label := NewLabel("Unicorn2000", 5)
|
||||
assert.Equal(t, "Unicorn2000", label.LabelName)
|
||||
assert.Equal(t, "unicorn2000", label.LabelSlug)
|
||||
assert.Equal(t, 5, label.LabelPriority)
|
||||
})
|
||||
t.Run("name Unknown", func(t *testing.T) {
|
||||
label := NewLabel("", -6)
|
||||
assert.Equal(t, "Unknown", label.LabelName)
|
||||
assert.Equal(t, "unknown", label.LabelSlug)
|
||||
assert.Equal(t, -6, label.LabelPriority)
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue