From c8efc24ef556473bd90609fc92426ec8e0a172fe Mon Sep 17 00:00:00 2001 From: Artyom Belousov Date: Sat, 6 Feb 2021 22:46:11 +0300 Subject: [PATCH] Added test for card formatting --- internal/cardsinfo/format_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 internal/cardsinfo/format_test.go diff --git a/internal/cardsinfo/format_test.go b/internal/cardsinfo/format_test.go new file mode 100644 index 0000000..5c94176 --- /dev/null +++ b/internal/cardsinfo/format_test.go @@ -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) +}