customer/internal/utils/tariff_test.go

19 lines
511 B
Go
Raw Normal View History

2023-06-22 09:36:43 +00:00
package utils_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/utils"
)
func TestCalculateCartPurchasesAmount(t *testing.T) {
t.Run("Успешное вычиление суммы корзины", func(t *testing.T) {
2023-09-14 10:07:28 +00:00
assert.Equal(t, uint64(200000), utils.CalculateCartPurchasesAmount([]models.Tariff{
2023-06-22 09:36:43 +00:00
{Price: 90000},
{Price: 110000},
}))
})
}