customer/internal/utils/transfer/tariff_test.go

26 lines
779 B
Go
Raw Normal View History

2023-05-30 11:33:57 +00:00
package transfer_test
import (
"testing"
"github.com/stretchr/testify/assert"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/discount"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils/transfer"
)
func TestTariffsToProductInformations(t *testing.T) {
t.Run("Успешный перевод массива моделей тарифов в массив информации о продуктах", func(t *testing.T) {
assert.Equal(t,
[]*discount.ProductInformation{
{ID: "1", Price: 20},
{ID: "2", Price: 10},
},
transfer.TariffsToProductInformations([]models.Tariff{
{ID: "1", Price: 20},
{ID: "2", Price: 10},
}),
)
})
}