Pact.Provider.Wrapper
1.5.0
See the version list below for details.
dotnet add package Pact.Provider.Wrapper --version 1.5.0
NuGet\Install-Package Pact.Provider.Wrapper -Version 1.5.0
<PackageReference Include="Pact.Provider.Wrapper" Version="1.5.0" />
<PackageVersion Include="Pact.Provider.Wrapper" Version="1.5.0" />
<PackageReference Include="Pact.Provider.Wrapper" />
paket add Pact.Provider.Wrapper --version 1.5.0
#r "nuget: Pact.Provider.Wrapper, 1.5.0"
#addin nuget:?package=Pact.Provider.Wrapper&version=1.5.0
#tool nuget:?package=Pact.Provider.Wrapper&version=1.5.0
About
In my use cases of Pactnet, i needed to perform broker related tasks in different jobs in cicd, i also wanted to be able to connect PactNet to my own broker. There fore there was some code repeating across all my projects that i preferred to have them as a separate package. And here it is.
This library
- Merges all available Pact files
- Performs tests per each interaction
- Publishes the results for each Endpoint.
- Each request path, is considered an api endpoint, it may have one or more interactions.
- The result of testing an endpoint, is successful when all interaction tests towards this endpoint is passed.
- Publishers are extendable, the package also contains an Html publisher which produces an html file presenting the results.
In my case, i publish the results to a badge server and i use these badges in my api wiki, so any team member can have see the state of implementation of apis at the api wiki.
Important Note |
---|
pact-net package wraps the ruby version of pact and when using it and you need to reference its package regarding the platform your tests are running at. So for example |
in my case, which i run my tests on a 64 bit linux, i add <PackageReference Include="PactNet.Linux.x64" Version="3.0.0" /> reference alongside the <PackageReference Include="Pact.Provider.Wrapper" /> reference in my csproj file (or via package manager and etc.). Other platforms can be PactNet.Windows, PactNet.Linux.x86 and PactNet.OSX |
Simple Example
// Unit test method based on exceptions like xUnit (with [Fact] attribute or NUnit or etc...
public void Providers_GivenPacts_ShouldHonorAllPacts(){
// settup your application
var app = SetupApp();
// Start api service(s)
app.Start();
// Create test bench
// This example assumes your services would be up at http://localhost:9222
var bench = new PactVerificationBench("http://localhost:9222");
// Assuming the test projects executable is built at
// <project-directory>/bin/<configuration>/<sdk>/<executable>
// for example: Example.Pact.Test/bin/Debug/netcoreapp3.1/Example.Pact.Test
bench.Verify("../../../../Pacts");
// Stop api service(s)
app.StopAsync().Wait();
}
Other Feature
- Run Tests Separately
- Use Matchers
- Register Request Filters
- Publish Results
- Using Pact Broker
- To Html file
- Using Custom Publisher(s)
- Verify Using PactNet (Rubby Wrapper) Or BuiltIn C# Pact verifier (InternalVerifier)
- Url Matching Patterns
- Url Matching for Endpoint test selection
- Url Matching for Request Filtering
More Details
For More detailed version of this readme file, please refer to Github Page for this project.
Updates
You can trace changes and updates log in Change log Document.
Regards.
Mani.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- PactNet (>= 2.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.6.6 | 396 | 11/30/2022 |
1.6.5 | 460 | 10/19/2022 |
1.6.4 | 579 | 9/14/2022 |
1.6.3 | 555 | 3/7/2022 |
1.6.2 | 370 | 12/12/2021 |
1.6.1 | 354 | 11/29/2021 |
1.5.8 | 351 | 11/28/2021 |
1.5.5 | 387 | 8/9/2021 |
1.5.4 | 391 | 7/24/2021 |
1.5.3 | 488 | 7/12/2021 |
1.5.2 | 428 | 7/7/2021 |
1.5.1 | 431 | 6/29/2021 |
1.5.0 | 435 | 6/29/2021 |
1.4.1 | 424 | 6/28/2021 |
1.4.0 | 373 | 6/28/2021 |
1.3.2 | 450 | 6/14/2021 |
1.3.1 | 442 | 6/13/2021 |
1.3.0 | 437 | 6/11/2021 |
1.2.0 | 404 | 6/4/2021 |
1.1.1 | 398 | 6/3/2021 |
1.1.0 | 382 | 6/2/2021 |
1.0.0 | 425 | 5/18/2021 |