Assertion objects have some common capabilities. For example, both the JsonSchemaAssertions and the JsonResponseAssertions allow the user to set an expected content type. The code that handles this kind of common functionality is currently duplicated in these requests. There may be other cases of this. At the end of the day, these objects are all making assertions on HTTP responses, so they are bound to have some common functionality.
We need to refactor the assertions to abstract this common functionality.
Suggestion from @KPull: We can abstract this into a CommonAssertions object (just like we have CommonRequestAttributes), and have the applicable assertions inherit from CommonAssertions by composition.
Assertion objects have some common capabilities. For example, both the
JsonSchemaAssertions
and theJsonResponseAssertions
allow the user to set an expected content type. The code that handles this kind of common functionality is currently duplicated in these requests. There may be other cases of this. At the end of the day, these objects are all making assertions on HTTP responses, so they are bound to have some common functionality.We need to refactor the assertions to abstract this common functionality.
Suggestion from @KPull: We can abstract this into a
CommonAssertions
object (just like we haveCommonRequestAttributes
), and have the applicable assertions inherit fromCommonAssertions
by composition.