pact-net

How to ConfigureServices in Asp.Net core WebAPI from another assembly

浪子不回头ぞ 提交于 2020-02-05 09:53:29
问题 In a microservice environment I need to construct a framework for Contract based testing. I'm currently investigatingh how to isolate a single service from it's external dependencies inorder to execute the Provider tests. What I need to do is: Keep the WebApi project intact Start an instance of the WepApi with some config-differences Mock out selected dependencies My Solution structure is this: Case-Solution/ ├── src/ | ├──Case.Api | └──Case.Application ├── test/ | ├──Case.Api.Unittest | ├──

PACT .NET consumer test: flexible length array

被刻印的时光 ゝ 提交于 2019-12-23 19:01:15
问题 I am using pactNet to test an API which should return an array of a flexible length. If i call "myApi/items/" it should return a list of items where the consumer does not know the exact size of. So the answer should look like this: [ { "id": "1", "description": "foo" }, { "id": "2", "description": "foo2" }, { "id": "3", "description": "foo3" } ] or this: [ { "id": "4", "description": "foo4" }, { "id": "2", "description": "foo2" } ] How do I create the contract for this interaction? In the