I have an MVC application that needs to invoke a REST API from a third party vendor.
The REST API should return a JSON result, but it won't be ready before we start developing and testing our MVC application, so I would like to mock the REST API (that vendors will be providing).
I researched MOQ but it doesn't seem to support mocking of REST API.
The best approach probably depends what requires the least learning curve and setup for you and what fits in your environment.
I have done this kind of thing using node.js and express. It was a very quick start up, and easy to do. As a minimal case I just put the json I need in files and serve them in response to REST requests. Changing the routes around to match an api is pretty easy. I am lazy sometimes about json files so I write queries in SQL to produce them, or write js code to produce them if I need a lot of data.
If you are using ASP.NET MVC (not sure that's the MVC you meant), it is pretty good as defining routes to make a REST API. You might not need extra tools.
I like a real server and a real language better than a canned tool. If you are a tester familiar with Selenium and Javascript, the Node.js approach might be the best win for you. You know the language, and don't have to invest much to get a server going.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With