generated from PenaSide/GolangTemplate
19 lines
510 B
Go
19 lines
510 B
Go
![]() |
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) {
|
||
|
assert.Equal(t, int64(200000), utils.CalculateCartPurchasesAmount([]models.Tariff{
|
||
|
{Price: 90000},
|
||
|
{Price: 110000},
|
||
|
}))
|
||
|
})
|
||
|
}
|