implement statuscode in packets
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 2m2s

This commit is contained in:
matst80
2024-11-11 23:24:03 +01:00
parent 9c15251f67
commit 0b290a32bf
17 changed files with 295 additions and 226 deletions

View File

@@ -88,8 +88,8 @@ func TestAddToCart(t *testing.T) {
if err != nil {
t.Errorf("Error handling message: %v\n", err)
}
if len(result) == 0 {
t.Errorf("Expected result, got nil\n")
if result.StatusCode != 200 {
t.Errorf("Call failed\n")
}
if grain.TotalPrice != 200 {
t.Errorf("Expected total price 200, got %d\n", grain.TotalPrice)
@@ -104,8 +104,8 @@ func TestAddToCart(t *testing.T) {
if err != nil {
t.Errorf("Error handling message: %v\n", err)
}
if len(result) == 0 {
t.Errorf("Expected result, got nil\n")
if result.StatusCode != 200 {
t.Errorf("Call failed\n")
}
if grain.Items[0].Quantity != 4 {
t.Errorf("Expected quantity 4, got %d\n", grain.Items[0].Quantity)
@@ -146,8 +146,8 @@ func TestSetDelivery(t *testing.T) {
if err != nil {
t.Errorf("Error handling message: %v\n", err)
}
if len(result) == 0 {
t.Errorf("Expected result, got nil\n")
if result.StatusCode != 200 {
t.Errorf("Call failed\n")
}
setDelivery := GetMessage(SetDeliveryType, &messages.SetDelivery{
@@ -198,8 +198,8 @@ func TestSetDeliveryOnAll(t *testing.T) {
if err != nil {
t.Errorf("Error handling message: %v\n", err)
}
if len(result) == 0 {
t.Errorf("Expected result, got nil\n")
if result.StatusCode != 200 {
t.Errorf("Call failed\n")
}
setDelivery := GetMessage(SetDeliveryType, &messages.SetDelivery{