answer/internal/repo/repo_test/reason_repo_test.go

19 lines
490 B
Go

package repo_test
import (
"context"
"testing"
"github.com/answerdev/answer/internal/repo/config"
"github.com/answerdev/answer/internal/repo/reason"
"github.com/stretchr/testify/assert"
)
func Test_reasonRepo_ListReasons(t *testing.T) {
configRepo := config.NewConfigRepo(testDataSource)
reasonRepo := reason.NewReasonRepo(configRepo)
reasonItems, err := reasonRepo.ListReasons(context.TODO(), "question", "close")
assert.NoError(t, err)
assert.Equal(t, 4, len(reasonItems))
}