Skip to content

Commit

Permalink
[ODS-5991] Improve error message (#840)
Browse files Browse the repository at this point in the history
* Improve error message

* Fix Postman Tests
  • Loading branch information
simpat-adam authored Oct 5, 2023
1 parent 271edc5 commit 0abd7f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override ValidationResult IsValid(object value, ValidationContext vali
{
if(resource.GetUnassignedMemberNames().Any())
{
return new ValidationResult("Required value not explicitly assigned.", resource.GetUnassignedMemberNames());
return new ValidationResult("Required", resource.GetUnassignedMemberNames());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5211,7 +5211,7 @@
"\r",
"pm.test(\"Should return a message indicating that Validation failed. TotalInstructionalDays is not explicitly assigned\", () => {\r",
" const responseItem = pm.response.json();\r",
" pm.expect(responseItem.modelState[\"request.TotalInstructionalDays\"][0]).to.include(\"Required value not explicitly assigned.\");\r",
" pm.expect(responseItem.modelState[\"request.TotalInstructionalDays\"][0]).to.include(\"Required\");\r",
"});"
],
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6449,9 +6449,7 @@
" return (message === expectedErrorMessage1);\r",
" });\r",
"\r",
" if (request && request.FiscalYear) {\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"]).to.contain(\"Required value not explicitly assigned.\");\r",
" }\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"][0]).to.equal(\"Required\");\r",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -6528,9 +6526,7 @@
" return (message === expectedErrorMessage1);\r",
" });\r",
"\r",
" if (request && request.FiscalYear) {\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"]).to.contain(\"Required value not explicitly assigned.\");\r",
" }\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"][0]).to.equal(\"Required\");\r",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -6607,9 +6603,7 @@
" return (message === expectedErrorMessage1);\r",
" });\r",
"\r",
" if (request && request.FiscalYear) {\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"]).to.contain(\"Required value not explicitly assigned.\");\r",
" }\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"][0]).to.equal(\"Required\");\r",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -6957,13 +6951,10 @@
"\r",
" const responseItem = pm.response.json();\r",
" const expectedErrorMessage1 = \"The request is invalid.\";\r",
" pm.expect(responseItem.message).to.satisfy(function (message) {\r",
" return (message === expectedErrorMessage1);\r",
" });\r",
" pm.expect(responseItem.message).to.equal(expectedErrorMessage1);\r",
"\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"][0]).to.equal(\"Required\");\r",
"\r",
" if (request && request.FiscalYear) {\r",
" pm.expect(responseItem.modelState[\"request.FiscalYear\"]).to.contain(\"Required value not explicitly assigned.\");\r",
" }\r",
"});"
],
"type": "text/javascript"
Expand Down

0 comments on commit 0abd7f5

Please sign in to comment.