mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 18:54:51 +01:00
* 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>
30 lines
1.0 KiB
C#
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.");
|
|
}
|
|
}
|
|
} |