basdijkstra / rest-assured-net

C# DSL for writing readable tests for HTTP-based APIs
Apache License 2.0
139 stars 18 forks source link

Add support for WireMock.Net matchers #1

Open StefH opened 1 year ago

StefH commented 1 year ago

Hi Bas, just a remark...

Instead of using NHamcrest to do the matching, you could also use the WireMock.Net matchers: https://github.com/WireMock-Net/WireMock.Net/tree/master/src/WireMock.Net/Matchers

basdijkstra commented 1 year ago

Thank you for the suggestion, Stef. At first glance it shouldn’t be too hard to do, so I’ll add it to the list.

StefH commented 1 year ago

The only thing which differs is that WireMock.Net does not have any static new helper methods / fluent helper methods yet.

So in Hamcrest you can do:

  ...
  .Body(NHamcrest.Is.EqualTo("California"));

For now the equivalent using WireMock is:

  ...
  .Body(new ExactMatcher("California"));

A possible fluent interface for WireMock could be:

  ...
  .Body(WireMockMatcher.Is.EqualTo("California"));