Comments (6)
I can only reproduce this when the body in the Pact is { "Test":true }
and the body in the actual message is { "Test":"false" }
.
In that case it is expected behaviour because the types don't match.
Either just use booleans, in which case you don't need the regex, or use strings in both the pact and the actual message.
from com-pact.
@bartschotten
Thanks, but how do i describe boolean in pact definition? There is no Some.Boolean
from com-pact.
You can just use Some.Element. Booleans do not really have a specific meaning in Pact so there was no need to create a specific method for it, but I can see why it may be a bit confusing.
from com-pact.
@bartschotten , but how do i ensure that values are only true/false ?
Some.Element.Named("BooleanProperty").Like(true) ?
from com-pact.
Exactly. That will automatically result in a Type matching rule.
from com-pact.
Nice! Thanks. Now i understand the point .
from com-pact.
Related Issues (15)
- ComPact can be used/referenced in .NET Standard HOT 2
- HTTP 500 From Mock Server For V2 Consumer Tests HOT 9
- Feature Request: WithBody Pass Object HOT 3
- Failed to call MockProvider due to synchronized I/O call HOT 2
- Provider interactions failing when verifying body HOT 4
- Strings formatted as ISO datetimes get deserialized to DateTime instead of string HOT 7
- PactWriter writes to wrong path HOT 2
- Support asynchronous MessageBuilder VerifyConsumer HOT 4
- Error message renders type instead of any relevant value HOT 1
- ArgumentNullException when matchingRules are empty HOT 3
- Question: Work with matchers in content HOT 2
- Using Matchers in request body HOT 3
- Make difference clear between infrastructure and verification exceptions HOT 1
- Matching seems to fail when JToken evaluates types other than what's in the spec HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from com-pact.