Added different formatting for telegram bot
This commit is contained in:
parent
35f8fa5a57
commit
89623f5f6a
18 changed files with 233 additions and 173 deletions
25
internal/telegram/sender_test.go
Normal file
25
internal/telegram/sender_test.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package telegram
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gitlab.com/flygrounder/go-mtg-vk/internal/cardsinfo"
|
||||
)
|
||||
|
||||
func Test_formatCardPrices(t *testing.T) {
|
||||
prices := []cardsinfo.ScgCardPrice{
|
||||
{
|
||||
Price: "1",
|
||||
Edition: "Alpha",
|
||||
Link: "scg1",
|
||||
},
|
||||
{
|
||||
Price: "2",
|
||||
Edition: "Beta",
|
||||
Link: "scg2",
|
||||
},
|
||||
}
|
||||
result := formatCardPrices("card", prices)
|
||||
assert.Equal(t, "Оригинальное название: card\n\n1. [Alpha](scg1): 1\n2. [Beta](scg2): 2\n", result)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue