mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-17 23:03:46 +01:00
* Create WireMock.Net.MimePart project * . * REFACTOR * ILRepack * -- * ... * x * x * . * fix * public class MimePartMatcher * shared * min * . * <!--<DelaySign>true</DelaySign>--> * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
// Copyright © WireMock.Net
|
|
|
|
using System;
|
|
using WireMock.Types;
|
|
|
|
namespace WireMock.ResponseBuilders;
|
|
|
|
public partial class Response
|
|
{
|
|
/// <inheritdoc cref="ITransformResponseBuilder.WithTransformer(bool)"/>
|
|
public IResponseBuilder WithTransformer(bool transformContentFromBodyAsFile)
|
|
{
|
|
return WithTransformer(TransformerType.Handlebars, transformContentFromBodyAsFile);
|
|
}
|
|
|
|
/// <inheritdoc cref="ITransformResponseBuilder.WithTransformer(ReplaceNodeOptions)"/>
|
|
public IResponseBuilder WithTransformer(ReplaceNodeOptions options)
|
|
{
|
|
return WithTransformer(TransformerType.Handlebars, false, options);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public IResponseBuilder WithTransformer(TransformerType transformerType, bool transformContentFromBodyAsFile = false, ReplaceNodeOptions options = ReplaceNodeOptions.EvaluateAndTryToConvert)
|
|
{
|
|
if (_bodyFromFileSet)
|
|
{
|
|
throw new InvalidOperationException("WithTransformer should be used before WithBodyFromFile.");
|
|
}
|
|
|
|
UseTransformer = true;
|
|
TransformerType = transformerType;
|
|
UseTransformerForBodyAsFile = transformContentFromBodyAsFile;
|
|
TransformerReplaceNodeOptions = options;
|
|
return this;
|
|
}
|
|
} |