mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
feat: add unit test for cross-border JSON round-trip functionality
This commit is contained in:
parent
6c4170f1e1
commit
075f72c2d9
19
internal/server/product_cross_border_test.go
Normal file
19
internal/server/product_cross_border_test.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
productv1 "llms.idsbuybuybuy.com/ecommerce/ids-proto/gen/go/ids/product/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCrossBorderJSONRoundTripsPortCode(t *testing.T) {
|
||||||
|
raw, err := crossBorderJSONFromProto(&productv1.CrossBorderInfo{
|
||||||
|
PortCode: "3100",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("marshal cross-border info: %v", err)
|
||||||
|
}
|
||||||
|
if got := toProtoCrossBorderInfo(raw).GetPortCode(); got != "3100" {
|
||||||
|
t.Fatalf("round-trip port_code = %q, want %q", got, "3100")
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user