Added test for card formatting

This commit is contained in:
Artyom Belousov 2021-02-06 22:46:11 +03:00
parent 121bb9fc9c
commit c8efc24ef5

View file

@ -0,0 +1,17 @@
package cardsinfo
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFormatCardPrices(t *testing.T) {
formatted := FormatCardPrices("card", []CardPrice{
&ScgCardPrice{
Price: "1.5$",
Edition: "ED",
Link: "scg.com",
},
})
assert.Equal(t, "Оригинальное название: card\nРезультатов: 1\n1. ED: 1.5$\nscg.com\n", formatted)
}