Add 'Data' to response which can be used during transforming the response (#893)

* Add 'Data' to response which can be used during transforming the response

* md

* hb

* fix

* Linq

* fix test

* v4

* 14

* .

* x

* remove

* s
This commit is contained in:
Stef Heyenrath
2023-03-09 17:20:34 +01:00
committed by GitHub
parent 36c9d95abb
commit 7426bf76ee
28 changed files with 543 additions and 268 deletions

View File

@@ -2,6 +2,7 @@
// For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root.
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Stef.Validation;
using WireMock.Matchers.Request;
using WireMock.Models;
@@ -39,6 +40,8 @@ internal class RespondWithAProvider : IRespondWithAProvider
public ITimeSettings? TimeSettings { get; private set; }
public object? Data { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="RespondWithAProvider"/> class.
/// </summary>
@@ -88,10 +91,20 @@ internal class RespondWithAProvider : IRespondWithAProvider
_timesInSameState,
Webhooks,
_useWebhookFireAndForget,
TimeSettings);
TimeSettings,
Data);
_registrationCallback(mapping, _saveToFile);
}
/// <inheritdoc />
[PublicAPI]
public IRespondWithAProvider WithData(object data)
{
Data = data;
return this;
}
/// <inheritdoc />
public IRespondWithAProvider WithGuid(string guid)
{