Covered handler.go with tests
This commit is contained in:
parent
f0f64bd511
commit
d5f9a495b7
7 changed files with 259 additions and 68 deletions
|
|
@ -9,26 +9,6 @@ type CardPrice interface {
|
|||
Format() string
|
||||
}
|
||||
|
||||
type TcgCardPrice struct {
|
||||
FullArt bool
|
||||
Name string
|
||||
Price string
|
||||
PriceFoil string
|
||||
Link string
|
||||
Edition string
|
||||
}
|
||||
|
||||
func (t *TcgCardPrice) Format() string {
|
||||
return fmt.Sprintf("%v\nRegular: %v\nFoil: %v\n%v\n", t.Edition, formatTcgPrice(t.Price), formatTcgPrice(t.PriceFoil), t.Link)
|
||||
}
|
||||
|
||||
func formatTcgPrice(price string) string {
|
||||
if price == "" {
|
||||
return "-"
|
||||
}
|
||||
return fmt.Sprintf("$%v", price)
|
||||
}
|
||||
|
||||
type ScgCardPrice struct {
|
||||
Price string
|
||||
Edition string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue