From adead738cd92653dc7492fcdcf03bbe024d34206 Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Tue, 16 Jul 2019 12:57:55 +0200 Subject: [PATCH] Add tests for label model --- internal/models/label_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 internal/models/label_test.go diff --git a/internal/models/label_test.go b/internal/models/label_test.go new file mode 100644 index 000000000..b6fce9b8d --- /dev/null +++ b/internal/models/label_test.go @@ -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) + }) +}