From 1975339bf2edd991b17a5a9e836d6b7f94b5f9be Mon Sep 17 00:00:00 2001 From: glaxxie <86179463+glaxxie@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:38:29 -0600 Subject: [PATCH 1/5] test test suite change [no important files changed] --- exercises/practice/rest-api/RestApi.tests.ps1 | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/exercises/practice/rest-api/RestApi.tests.ps1 b/exercises/practice/rest-api/RestApi.tests.ps1 index db65bb1..be86d00 100644 --- a/exercises/practice/rest-api/RestApi.tests.ps1 +++ b/exercises/practice/rest-api/RestApi.tests.ps1 @@ -26,7 +26,7 @@ Describe "RestApi test cases" { It "user management -> get single user" { $data = @{ users = @( - @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -45,7 +45,7 @@ Describe "RestApi test cases" { It "user management -> adding existing user throw error" { $data = @{ users = @( - @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -57,7 +57,7 @@ Describe "RestApi test cases" { It "iou -> both users have 0 balance" { $data = @{ users = @( - @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -65,7 +65,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam"; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} + @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0} ; balance = 3.0} @{name = "Bob" ; owes = @{Adam = 3.0}; owed_by = @{}; balance = -3.0} ) } @@ -76,7 +76,7 @@ Describe "RestApi test cases" { It "iou -> borrower has negative balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Chuck" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} ) @@ -85,7 +85,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} + @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} @{name = "Bob" ; owes = @{Adam = 3.0 ; Chuck = 3.0}; owed_by = @{}; balance = -6.0} ) } @@ -96,7 +96,7 @@ Describe "RestApi test cases" { It "iou -> lender has negative balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Chuck" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} ) @@ -106,7 +106,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{Adam = 3.0}; balance = 0.0} + @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{Adam = 3.0}; balance = 0.0} ) } @@ -117,7 +117,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -125,7 +125,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{Bob = 1.0}; owed_by = @{}; balance = -1.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 1.0}; balance = 1.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 1.0}; balance = 1.0} ) } @@ -136,7 +136,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -144,7 +144,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 1.0}; balance = 1.0} - @{name = "Bob" ; owes = @{Adam = 1.0}; owed_by = @{}; balance = -1.0} + @{name = "Bob" ; owes = @{Adam = 1.0}; owed_by = @{}; balance = -1.0} ) } @@ -155,7 +155,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -163,7 +163,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} - @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } From c9b5a4414c96a9b5e9463566581ca875e8d278e0 Mon Sep 17 00:00:00 2001 From: glaxxie <86179463+glaxxie@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:53:48 -0600 Subject: [PATCH 2/5] Revert "test" This reverts commit 1975339bf2edd991b17a5a9e836d6b7f94b5f9be. --- exercises/practice/rest-api/RestApi.tests.ps1 | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/exercises/practice/rest-api/RestApi.tests.ps1 b/exercises/practice/rest-api/RestApi.tests.ps1 index be86d00..db65bb1 100644 --- a/exercises/practice/rest-api/RestApi.tests.ps1 +++ b/exercises/practice/rest-api/RestApi.tests.ps1 @@ -26,7 +26,7 @@ Describe "RestApi test cases" { It "user management -> get single user" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -45,7 +45,7 @@ Describe "RestApi test cases" { It "user management -> adding existing user throw error" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -57,7 +57,7 @@ Describe "RestApi test cases" { It "iou -> both users have 0 balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam"; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } @@ -65,7 +65,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0} ; balance = 3.0} + @{name = "Adam"; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} @{name = "Bob" ; owes = @{Adam = 3.0}; owed_by = @{}; balance = -3.0} ) } @@ -76,7 +76,7 @@ Describe "RestApi test cases" { It "iou -> borrower has negative balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Chuck" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} ) @@ -85,7 +85,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} + @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} @{name = "Bob" ; owes = @{Adam = 3.0 ; Chuck = 3.0}; owed_by = @{}; balance = -6.0} ) } @@ -96,7 +96,7 @@ Describe "RestApi test cases" { It "iou -> lender has negative balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Chuck" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} ) @@ -106,7 +106,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{Adam = 3.0}; balance = 0.0} + @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{Adam = 3.0}; balance = 0.0} ) } @@ -117,7 +117,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -125,7 +125,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{Bob = 1.0}; owed_by = @{}; balance = -1.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 1.0}; balance = 1.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 1.0}; balance = 1.0} ) } @@ -136,7 +136,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -144,7 +144,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 1.0}; balance = 1.0} - @{name = "Bob" ; owes = @{Adam = 1.0}; owed_by = @{}; balance = -1.0} + @{name = "Bob" ; owes = @{Adam = 1.0}; owed_by = @{}; balance = -1.0} ) } @@ -155,7 +155,7 @@ Describe "RestApi test cases" { $data = @{ users = @( @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} - @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} + @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } $api = [RestAPI]::new($data) @@ -163,7 +163,7 @@ Describe "RestApi test cases" { $want = @{ users = @( @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} - @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Bob" ; owes = @{}; owed_by = @{}; balance = 0.0} ) } From df9b2cb317b42a2402115f1026baeb7a8c07a0d1 Mon Sep 17 00:00:00 2001 From: glaxxie <86179463+glaxxie@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:54:28 -0600 Subject: [PATCH 3/5] Update RestApi.ps1 test2 --- exercises/practice/rest-api/RestApi.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/practice/rest-api/RestApi.ps1 b/exercises/practice/rest-api/RestApi.ps1 index f669272..df05e3d 100644 --- a/exercises/practice/rest-api/RestApi.ps1 +++ b/exercises/practice/rest-api/RestApi.ps1 @@ -31,6 +31,7 @@ Returns: @{ users = @( # Post method to add a new user $api.Post("/add", '{"users":["Chuck"]}') Returns: @{ name = "Chuck"; owes = @{}; owed_by = @{}; balance = 0.0 } +#testing in stub #> Class RestAPI{ From 379259ec4f4b33a2806d17c65121c1e057b8c83f Mon Sep 17 00:00:00 2001 From: glaxxie <86179463+glaxxie@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:56:06 -0600 Subject: [PATCH 4/5] Revert "Update RestApi.ps1" This reverts commit df9b2cb317b42a2402115f1026baeb7a8c07a0d1. --- exercises/practice/rest-api/RestApi.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/practice/rest-api/RestApi.ps1 b/exercises/practice/rest-api/RestApi.ps1 index df05e3d..f669272 100644 --- a/exercises/practice/rest-api/RestApi.ps1 +++ b/exercises/practice/rest-api/RestApi.ps1 @@ -31,7 +31,6 @@ Returns: @{ users = @( # Post method to add a new user $api.Post("/add", '{"users":["Chuck"]}') Returns: @{ name = "Chuck"; owes = @{}; owed_by = @{}; balance = 0.0 } -#testing in stub #> Class RestAPI{ From ed2acfbff95c75f825888836cdaf1c0bd93670eb Mon Sep 17 00:00:00 2001 From: glaxxie <86179463+glaxxie@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:57:08 -0600 Subject: [PATCH 5/5] Update RestApi.tests.ps1 change in test suite --- exercises/practice/rest-api/RestApi.tests.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/practice/rest-api/RestApi.tests.ps1 b/exercises/practice/rest-api/RestApi.tests.ps1 index db65bb1..eb0367b 100644 --- a/exercises/practice/rest-api/RestApi.tests.ps1 +++ b/exercises/practice/rest-api/RestApi.tests.ps1 @@ -85,7 +85,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} + @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} @{name = "Bob" ; owes = @{Adam = 3.0 ; Chuck = 3.0}; owed_by = @{}; balance = -6.0} ) } @@ -96,7 +96,7 @@ Describe "RestApi test cases" { It "iou -> lender has negative balance" { $data = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} + @{name = "Adam" ; owes = @{}; owed_by = @{}; balance = 0.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Chuck" ; owes = @{}; owed_by = @{Bob = 3.0}; balance = 3.0} ) @@ -105,7 +105,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Bob", "borrower": "Adam", "amount": 3.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} + @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Bob" ; owes = @{Chuck = 3.0}; owed_by = @{Adam = 3.0}; balance = 0.0} ) } @@ -116,7 +116,7 @@ Describe "RestApi test cases" { It "iou -> lender owes borrower" { $data = @{ users = @( - @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} + @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } @@ -124,7 +124,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 2.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{Bob = 1.0}; owed_by = @{}; balance = -1.0} + @{name = "Adam" ; owes = @{Bob = 1.0}; owed_by = @{}; balance = -1.0} @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 1.0}; balance = 1.0} ) } @@ -135,7 +135,7 @@ Describe "RestApi test cases" { It "iou -> lender owes borrower less than new loan" { $data = @{ users = @( - @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} + @{name = "Adam" ; owes = @{Bob = 3.0}; owed_by = @{}; balance = -3.0} @{name = "Bob" ; owes = @{}; owed_by = @{Adam = 3.0}; balance = 3.0} ) } @@ -143,7 +143,7 @@ Describe "RestApi test cases" { $got = $api.Post("/iou", '{"lender": "Adam", "borrower": "Bob", "amount": 4.0}') $want = @{ users = @( - @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 1.0}; balance = 1.0} + @{name = "Adam" ; owes = @{}; owed_by = @{Bob = 1.0}; balance = 1.0} @{name = "Bob" ; owes = @{Adam = 1.0}; owed_by = @{}; balance = -1.0} ) }