Functional contract testing ServiceStack services
While integration tests can combine several layers of our software, they are not definitive tests of all of your application from the outside in. If your team is publishing a service that only your team depends on, and you have an existing UI functional suite, then this is likely to be sufficient, and the techniques that we will explain now won't be required.
However, if your team publishes a service that is used by several other groups, you might find yourself wanting to build a functional test suite for the actual API of your service, enforcing the contract between the API consumer and the maintainer of the API.
While we can usually use JsonServiceClient
to test a ServiceStack endpoint, the fact that it automatically picks up any changes to routes will work against us when we do functional testing. If a service's routes change unintentionally, and a service no longer responds to PUT
in the way that it did in the past, the C# JsonServiceClient...