From 7c70e0c4dbf39422d5ccf2a4ca7206ddd0e85391 Mon Sep 17 00:00:00 2001 From: Marcin Celej Date: Thu, 16 May 2024 08:00:09 +0200 Subject: [PATCH] #18: Synergy.Web.Api.Testing: Added method of ignoring request headers --- Web/Synergy.Web.Api.Testing/Json/Ignore.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Web/Synergy.Web.Api.Testing/Json/Ignore.cs b/Web/Synergy.Web.Api.Testing/Json/Ignore.cs index de3b2e2..2a25940 100644 --- a/Web/Synergy.Web.Api.Testing/Json/Ignore.cs +++ b/Web/Synergy.Web.Api.Testing/Json/Ignore.cs @@ -40,6 +40,15 @@ public static Ignore RequestMethod() return new Ignore("$.request.method"); } + public static Ignore RequestHeaders(params string[] headers) + { + var ignore = new Ignore(); + if (headers.Any() == false) + ignore.Append(new[] {"$.request.headers"}); + ignore.Append(headers.Select(node=> $"$.request.headers.{node}")); + return ignore; + } + public static Ignore RequestDescription() { return new Ignore("$.request.description");