I'm trying to write a consumer test for an API method that can receive a post request with email message data and send a corresponding email. The API method returns status code ok if everything is ok but does not return a proper status code in some invalid cases currently. Its not clear to me what to do with the .WithStatus() method:
pact.UponReceiving("a request to post an email message with an invalid email address")
.WithRequest(
HttpMethod.Post, "/v1/Mail")
.WithBody(requestBody, "application/json")
.WillRespond()
.WithStatus(?);
I would like to do something like .WithStatus(Match.Type("integer")) but I can see that this is not possible. Is there a way to create a pact that does not care what status code is returned for some invalid cases?