You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previous issues
Have you searched the issue tracker to ensure this hasn't been discussed before?
Yes but I did not find any discussion on this.
Version information:
OS: Windows x64
PactNet Version: 4.5
.Net Version: 6
Describe the bug
When creating contract using MinType to return at least a number of elements in array property only one element is returned by the fake server.
Steps To Reproduce
pact
.UponReceiving("A request to get some things")
.Given("There are some things")
.WithRequest(HttpMethod.Get, "/api/things")
.WithHeader("Accept", "application/json")
.WillRespond()
.WithStatus(HttpStatusCode.OK)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithJsonBody((
Match.MinType(new
{
thingId = Match.Regex("2", "^\\d+$"),
thingName = Match.Regex("SecondThing", "^\\w{1,12}$")
}, 3)));
await pact.VerifyAsync(async ctx => {
var thingsRepository = new HttpThingsRepository(ctx.MockServerUri.ToString());
var things = await thingsRepository.GetThings();
Assert.Equal(3, things.Count);
});
Expected behavior
I would expect the server to return 3 elements instead of one.
Log Output
This is the generated contract (after forcing test to pass by expecting one element)
adamrodger
added
upstream
Indicates that an issue relates to an upstream problem (such as in pact-reference)
and removed
triage
This issue is yet to be triaged by a maintainer
labels
Oct 6, 2024
Previous issues
Have you searched the issue tracker to ensure this hasn't been discussed before?
Yes but I did not find any discussion on this.
Version information:
Describe the bug
When creating contract using MinType to return at least a number of elements in array property only one element is returned by the fake server.
Steps To Reproduce
Expected behavior
I would expect the server to return 3 elements instead of one.
Log Output
This is the generated contract (after forcing test to pass by expecting one element)
Additional context
In previous version it was returning the number of items specified in the contract, this is how it was before:
The text was updated successfully, but these errors were encountered: