Initial commit

Includes:
SCG parser
MTG cards search
This commit is contained in:
Artyom Belousov 2019-05-10 14:59:37 +03:00
commit 1af9226764
8 changed files with 181 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package cardsinfo
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFetchPriceOne(t *testing.T) {
price, _ := fetchPrice("$2.28")
assert.Equal(t, 2.28, price)
}
func TestFetchPriceTwo(t *testing.T) {
price, _ := fetchPrice("$2.28$1.14")
assert.Equal(t, 2.28, price)
}
func TestFetchPriceNo(t *testing.T) {
_, err := fetchPrice("")
assert.NotNil(t, err)
}