customer/internal/initialize/repositories_test.go

26 lines
744 B
Go
Raw Normal View History

2023-05-16 01:12:07 +00:00
package initialize_test
import (
"testing"
"github.com/stretchr/testify/assert"
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
2023-05-16 04:01:55 +00:00
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
2023-05-16 01:12:07 +00:00
)
func TestNewRepositories(t *testing.T) {
mt := mtest.New(t, mtest.NewOptions().ClientType(mtest.Mock))
mt.Run("Репозитории должны успешно инициализироваться", func(t *mtest.T) {
assert.NotPanics(t, func() {
repositories := initialize.NewRepositories(&initialize.RepositoriesDeps{
MongoDB: t.Client.Database("test"),
})
assert.NotNil(t, repositories)
2023-05-17 20:27:09 +00:00
assert.NotNil(t, repositories.AccountRepository)
2023-05-16 01:12:07 +00:00
assert.NotNil(t, repositories.HealthRepository)
})
})
}