Closed mariacamenzuli closed 7 years ago
This change was simply copying the assertions on the content type from JsonResponseAssertions
over to JsonSchemaAssertions
. Can we come up with some kind of abstraction for the capabilities of the assertion classes to avoid this duplication? @FrelliBB @KPull
Can we come up with some kind of abstraction for the capabilities of the assertion classes to avoid this duplication?
Yes. I can forsee that an Assertions
object would typically want to assert the status code and content-type for example. We can abstract this into a CommonAssertions
object (just like we have CommonRequestAttributes
), and have the applicable assertions inherit from CommonAssertions
by composition.
I think it's best if we refactor the structure of the assertions in a separate pull request. I can open an issue.
I've applied the other changes requested.
Opened #66 for the assertion abstraction task.
Added assertions on the response content type in
JsonSchemaAssertions
.This fixes #59