extend tests

This commit is contained in:
diPhantxm
2023-03-18 03:05:06 +03:00
parent f59174519f
commit 466cbc6379
9 changed files with 322 additions and 33 deletions

View File

@@ -347,6 +347,10 @@ func TestPackOrder(t *testing.T) {
if resp.StatusCode != test.statusCode {
t.Errorf("got wrong status code: got: %d, expected: %d", resp.StatusCode, test.statusCode)
}
if len(resp.Result) != len(test.params.Packages) {
t.Errorf("Length of packages in request and response are not equal")
}
}
}
@@ -420,5 +424,16 @@ func TestValidateLabelingCodes(t *testing.T) {
if resp.StatusCode != test.statusCode {
t.Errorf("got wrong status code: got: %d, expected: %d", resp.StatusCode, test.statusCode)
}
if resp.StatusCode == http.StatusOK {
if len(resp.Result.Products) != len(test.params.Products) {
t.Errorf("Length of products in request and response are not equal")
}
if len(resp.Result.Products) > 0 {
if resp.Result.Products[0].ProductId != test.params.Products[0].ProductId {
t.Errorf("Product ids in request and response are not equal")
}
}
}
}
}