Skip to content

Commit

Permalink
refactor!: Remove obsolete extension methods
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrodger committed Jun 28, 2023
1 parent 5c2e1a2 commit c3bf630
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
3 changes: 2 additions & 1 deletion src/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<PackageReleaseNotes>
v5.0.0
- Add Pact Specification v4 support
- BREAKING CHANGE - Refactor verifier to support verifying combined HTTP and message pacts
- BREAKING CHANGE: Remove obsolete WithNativeBackend calls
- BREAKING CHANGE: Refactor verifier to support verifying combined HTTP and message pacts
</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
44 changes: 0 additions & 44 deletions src/PactNet/PactExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,6 @@ public static class PactExtensions
private static readonly object LogLocker = new object();
private static bool LogInitialised = false;

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
/// <param name="pact">Pact details</param>
/// <param name="port">Port for the mock server. If null, one will be assigned automatically</param>
/// <param name="host">Host for the mock server</param>
/// <returns>Pact builder</returns>
/// <remarks>
/// If multiple mock servers are started at the same time, you must make sure you don't supply the same port twice.
/// It is advised that the port is not specified whenever possible to allow PactNet to allocate a port dynamically
/// and ensure there are no port clashes
/// </remarks>
[Obsolete("Use WithHttpInteractions instead. Will be removed in PactNet 5.0.0")]
public static IPactBuilderV2 UsingNativeBackend(this IPactV2 pact, int? port = null, IPAddress host = IPAddress.Loopback)
=> pact.WithHttpInteractions(port, host);

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
/// <param name="pact">Pact details</param>
/// <param name="port">Port for the mock server. If null, one will be assigned automatically</param>
/// <param name="host">Host for the mock server</param>
/// <returns>Pact builder</returns>
/// <remarks>
/// If multiple mock servers are started at the same time, you must make sure you don't supply the same port twice.
/// It is advised that the port is not specified whenever possible to allow PactNet to allocate a port dynamically
/// and ensure there are no port clashes
/// </remarks>
[Obsolete("Use WithHttpInteractions instead. Will be removed in PactNet 5.0.0")]
public static IPactBuilderV3 UsingNativeBackend(this IPactV3 pact, int? port = null, IPAddress host = IPAddress.Loopback)
=> pact.WithHttpInteractions(port, host);

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
Expand Down Expand Up @@ -114,18 +82,6 @@ public static IPactBuilderV4 WithHttpInteractions(this IPactV4 pact, int? port =
return builder;
}

/// <summary>
/// Establish a new message pact using the native backend
/// </summary>
/// <param name="messagePact">Message Pact details</param>
/// <returns>Pact builder</returns>
[Obsolete("Use WithMessageInteractions instead. Will be removed in PactNet 5.0.0")]
public static IMessagePactBuilderV3 UsingNativeBackend(this IMessagePactV3 messagePact)
{
var pact = Pact.V3(messagePact.Consumer, messagePact.Provider, messagePact.Config);
return pact.WithMessageInteractions();
}

/// <summary>
/// Add asynchronous message (i.e. consumer/producer) interactions to the pact
/// </summary>
Expand Down

0 comments on commit c3bf630

Please sign in to comment.