This commit is contained in:
@ -51,3 +51,30 @@ func Test_parseGoodsCategory(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGood_GoodID(t *testing.T) {
|
||||
type fields struct {
|
||||
GoodLink string
|
||||
}
|
||||
tests := []struct {
|
||||
fields fields
|
||||
want int
|
||||
}{
|
||||
{
|
||||
fields: fields{
|
||||
GoodLink: "/itm/mortal-kombat-1-ua-kz-auto-24-7/4107232",
|
||||
},
|
||||
want: 4107232,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.fields.GoodLink, func(t *testing.T) {
|
||||
g := &Good{
|
||||
GoodLink: tt.fields.GoodLink,
|
||||
}
|
||||
if got := g.GoodID(); got != tt.want {
|
||||
t.Errorf("Good.GoodID() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user