Files
WireMock.Net-wiremock/src/WireMock.Net.Minimal/Transformers/TransformerFactory.cs
Stef Heyenrath 19e95325fa ProxyUrlTransformer (#1361)
* ProxyUrlTransformer

* tests

* Update src/WireMock.Net.Shared/Settings/ProxyUrlReplaceSettings.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-28 12:40:33 +02:00

30 lines
1.0 KiB
C#

// Copyright © WireMock.Net
using System;
using WireMock.Settings;
using WireMock.Transformers.Handlebars;
using WireMock.Transformers.Scriban;
using WireMock.Types;
namespace WireMock.Transformers;
internal static class TransformerFactory
{
internal static ITransformer Create(TransformerType transformerType, WireMockServerSettings settings)
{
switch (transformerType)
{
case TransformerType.Handlebars:
var factoryHandlebars = new HandlebarsContextFactory(settings);
return new Transformer(settings, factoryHandlebars);
case TransformerType.Scriban:
case TransformerType.ScribanDotLiquid:
var factoryDotLiquid = new ScribanContextFactory(settings.FileSystemHandler, transformerType);
return new Transformer(settings, factoryDotLiquid);
default:
throw new NotSupportedException($"{nameof(TransformerType)} '{transformerType}' is not supported.");
}
}
}