Files
gochat/backend/internal/service/coverage46_test.go
T

51 lines
1.3 KiB
Go

package service
import (
"context"
"testing"
"github.com/gochat/gochat/internal/repository"
"github.com/stretchr/testify/require"
)
func TestConversationService_GetByID_DB_Cov46(t *testing.T) {
db := newSimpleServiceTestDB(t)
repo := repository.NewConversationRepo(db)
msgRepo := repository.NewMessageRepo(db)
svc := NewConversationService(repo, msgRepo, nil, nil, nil, nil, nil)
_, err := svc.GetByID(context.Background(), 1)
require.Error(t, err)
}
func TestMessageService_GetByID_DB_Cov46(t *testing.T) {
db := newSimpleServiceTestDB(t)
repo := repository.NewMessageRepo(db)
svc := NewMessageService(repo, nil, nil)
_, _, err := svc.ListByConversation(context.Background(), 1, 0, 20)
_ = err
}
func TestArticleService_GetByID_DB_Cov46(t *testing.T) {
db := newSimpleServiceTestDB(t)
repo := repository.NewArticleRepo(db)
svc := NewArticleService(repo)
_, _, err := svc.ListByPortalID(context.Background(), 1, 0, 20)
_ = err
}
func TestTagService_GetByID_DB_Cov46(t *testing.T) {
db := newSimpleServiceTestDB(t)
repo := repository.NewTagRepo(db)
svc := NewTagService(repo)
_, err := svc.GetByID(context.Background(), 1)
_ = err
}
func TestFolderService_GetByID_DB_Cov46(t *testing.T) {
db := newSimpleServiceTestDB(t)
repo := repository.NewFolderRepo(db)
svc := NewFolderService(repo)
_, err := svc.GetByID(context.Background(), 1)
_ = err
}