EnsureSuccessStatusCode as an assertion by Mark Seemann
https://blog.ploeh.dk/2020/09/28/ensuresuccessstatuscode-as-an-assertion/
Assert Equality #Assert Success #Legibility #Conciseness #Carrying Coals to Newcastle #Conclusion # The problem with testing strict equality in this context is that it's often too narrow a definition of success. You may start by returning 200 OK as response to a POST request, but then later evolve the API to return 201 Created or 202 Accepted. Those status codes still indicate success, and are typically accompanied by more information (e.g. a Loc...
The problem with testing strict equality in this context is that it's often too narrow a definition of success. You may start by returning 200 OK as response to a POST request, but then later evolve the API to return 201 Created or 202 Accepted. Those status codes still indicate success, and are typically accompanied by more information (e.g. a Loc...
DA: 1 PA: 47 MOZ Rank: 45