12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package controllers_scraper
- import (
- "kkscrap-go/model"
- "testing"
- )
- func TestToProduct(t *testing.T) {
- ori := model.ItemInfo{
- SolutionName: "hello",
- Version: "",
- Emails: nil,
- DomainName: "",
- DomainURI: "",
- ItemName: "",
- ItemNick: "",
- ModelName: "",
- ModelNo: "",
- BrandName: "",
- Sku: "",
- ItemCategory: "",
- Manufacturer: "",
- Origin: "",
- Language: "",
- Currency: "",
- SalesPrice: 0,
- DeliveryPrice: 0,
- MinimumQty: 0,
- UserCredit: 0,
- Options: nil,
- Images: nil,
- ShortDesc: "",
- OriginDesc: "",
- TextDesc: "1234",
- }
- pro := toProductPage(ori)
- if pro.TextDesc != "1234" {
- t.Error("TextDesc is not equal")
- }
- if pro.SolutionName != "hello" {
- t.Error("SolutionType is not equal")
- }
- }
|