From c3bf630a06477ba3f8ed39893bce48ab942c6abe Mon Sep 17 00:00:00 2001 From: Adam Rodger Date: Tue, 27 Jun 2023 13:55:11 +0100 Subject: [PATCH] refactor!: Remove obsolete extension methods --- src/NuGet.targets | 3 ++- src/PactNet/PactExtensions.cs | 44 ----------------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/src/NuGet.targets b/src/NuGet.targets index 142b49c3..28425e0c 100644 --- a/src/NuGet.targets +++ b/src/NuGet.targets @@ -18,7 +18,8 @@ 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 diff --git a/src/PactNet/PactExtensions.cs b/src/PactNet/PactExtensions.cs index 86f0c8a7..32aa358f 100644 --- a/src/PactNet/PactExtensions.cs +++ b/src/PactNet/PactExtensions.cs @@ -13,38 +13,6 @@ public static class PactExtensions private static readonly object LogLocker = new object(); private static bool LogInitialised = false; - /// - /// Establish a new pact using the native backend - /// - /// Pact details - /// Port for the mock server. If null, one will be assigned automatically - /// Host for the mock server - /// Pact builder - /// - /// 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 - /// - [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); - - /// - /// Establish a new pact using the native backend - /// - /// Pact details - /// Port for the mock server. If null, one will be assigned automatically - /// Host for the mock server - /// Pact builder - /// - /// 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 - /// - [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); - /// /// Establish a new pact using the native backend /// @@ -114,18 +82,6 @@ public static IPactBuilderV4 WithHttpInteractions(this IPactV4 pact, int? port = return builder; } - /// - /// Establish a new message pact using the native backend - /// - /// Message Pact details - /// Pact builder - [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(); - } - /// /// Add asynchronous message (i.e. consumer/producer) interactions to the pact ///