Comments (4)
You mean you’re using a minimal API rather than the traditional controller-based APIs? I wouldn’t call that new versus old but rather a different design type, but I digress.
I’d like to see if there’s an easy way to do this, too. In my example here: https://github.com/basdijkstra/introduction-to-contract-testing-dotnet/tree/main/AddressProvider I had to wrap my API in a Startup / Program construct to enable adding the Pact service URL and ProviderStateMiddleware in my tests.
If there’s an easier way to do that, I’d love to learn more.
from pact-net.
I don't know .NET enough to tell you how, but the main thing you need to do is start your service so that it is accessible over an HTTP port (e.g. port 80
). If you can do that, then that's all that matters.
That is, how you start your service is irrelevant - Pact just communicates with it over HTTP.
from pact-net.
@basdijkstra I'm using new hosting model which has only Program.cs. And I'm not using minimal api. I'm using normal controllers. A simple .NET 7 API template with normal controller is what I'm using. I googled and found your example repo before raising issue here. I didnt check the contents inside Startup.cs. Now After checking your Startup.cs I'm wondering why this is needed? Can it be added directly in Program.cs?
from pact-net.
This is a duplicate of #444
from pact-net.
Related Issues (20)
- NUnit Framework Exception HOT 8
- 'object' does not contain a definition for 'WillRespond'
- dll.`s errors HOT 3
- Publish contracts to pact-broker using pactnet HOT 7
- Pact verification with CamelCase model names HOT 10
- Provider Verification results are not published in the pipeline but are published when test is run locally HOT 1
- Adding support for XML response expectation expressions HOT 4
- ClearInteraction when using messaging pacts HOT 5
- PactV3Options Port value not respected HOT 4
- Pact-Net: PactConfig does not appear to have parity with Pact-JS - Missing [Host] and [Port] properties HOT 1
- docs req - contributing guide
- Improve error message output
- Several critical and high security issues in libraries used in nuget package PactNet.OSX 3.0.2 HOT 6
- Wrong result validation when publishing pacts? HOT 11
- 'WithSslVerificationDisabled' doesnt disable ssl verification HOT 12
- Pact testing of protobuf messages failing due to content type JSON HOT 4
- Pact Merging Creates Duplicate Interactions HOT 2
- RFC: Pact Plugins HOT 6
- Pact json being overwritten by each test in C# .NET HOT 7
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 pact-net.