Unexported unnecessary members

This commit is contained in:
Artyom Belousov 2021-02-07 15:58:50 +03:00
parent 4da8e94bcc
commit d8a295be75
14 changed files with 134 additions and 115 deletions

View file

@ -15,33 +15,33 @@ func TestGetPrices_Ok(t *testing.T) {
file, _ := os.Open("test_data/AcademyRuinsTest.html")
gock.New(scgSearchUrlTemplate + "card").Reply(http.StatusOK).Body(file)
f := &Fetcher{}
prices, err := f.GetPrices("card")
prices, err := f.getPrices("card")
assert.Nil(t, err)
assert.Equal(t, []CardPrice{
&ScgCardPrice{
Price: "$6.99",
Edition: "Double Masters",
Link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm-309-enn/?sku=SGL-MTG-2XM-309-ENN1",
assert.Equal(t, []scgCardPrice{
{
price: "$6.99",
edition: "Double Masters",
link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm-309-enn/?sku=SGL-MTG-2XM-309-ENN1",
},
&ScgCardPrice{
Price: "$9.99",
Edition: "Double Masters (Foil)",
Link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm-309-enf/?sku=SGL-MTG-2XM-309-ENF1",
{
price: "$9.99",
edition: "Double Masters (Foil)",
link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm-309-enf/?sku=SGL-MTG-2XM-309-ENF1",
},
&ScgCardPrice{
Price: "$11.99",
Edition: "Double Masters - Variants",
Link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm2-369-enn/?sku=SGL-MTG-2XM2-369-ENN1",
{
price: "$11.99",
edition: "Double Masters - Variants",
link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm2-369-enn/?sku=SGL-MTG-2XM2-369-ENN1",
},
&ScgCardPrice{
Price: "$14.99",
Edition: "Double Masters - Variants (Foil)",
Link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm2-369-enf/?sku=SGL-MTG-2XM2-369-ENF1",
{
price: "$14.99",
edition: "Double Masters - Variants (Foil)",
link: "https://starcitygames.com/academy-ruins-sgl-mtg-2xm2-369-enf/?sku=SGL-MTG-2XM2-369-ENF1",
},
&ScgCardPrice{
Price: "$7.99",
Edition: "Modern Masters: 2013 Edition",
Link: "https://starcitygames.com/academy-ruins-sgl-mtg-mma-219-enn/?sku=SGL-MTG-MMA-219-ENN1",
{
price: "$7.99",
edition: "Modern Masters: 2013 Edition",
link: "https://starcitygames.com/academy-ruins-sgl-mtg-mma-219-enn/?sku=SGL-MTG-MMA-219-ENN1",
},
}, prices)
}
@ -51,7 +51,7 @@ func TestGetPrices_Unavailable(t *testing.T) {
gock.New(scgSearchUrlTemplate + "card").Reply(http.StatusBadGateway)
f := &Fetcher{}
_, err := f.GetPrices("card")
_, err := f.getPrices("card")
assert.NotNil(t, err)
}
@ -61,7 +61,7 @@ func TestGetPrices_Empty(t *testing.T) {
file, _ := os.Open("test_data/EmptyTest.html")
gock.New(scgSearchUrlTemplate + "card").Reply(http.StatusOK).Body(file)
f := &Fetcher{}
prices, err := f.GetPrices("card")
prices, err := f.getPrices("card")
assert.Nil(t, err)
assert.Nil(t, prices)
}